From d6c643a39b280c11d4e0345f71bf0c2561b05d2c Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 15 Sep 2023 15:17:15 -0700 Subject: [PATCH] End-to-end user journey test complete --- page-objects/PaymentPage.js | 7 +++++-- tests/new_user_full_journey.spec.js | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/page-objects/PaymentPage.js b/page-objects/PaymentPage.js index f84ee42..f1e45ec 100644 --- a/page-objects/PaymentPage.js +++ b/page-objects/PaymentPage.js @@ -62,7 +62,6 @@ export class PaymentPage { } fillPaymentDetails = async (paymentDetails) => { - await this.cardOwner.waitFor() await this.cardOwner.fill(paymentDetails.owner) await this.cardNumber.waitFor() @@ -71,7 +70,11 @@ export class PaymentPage { await this.cardDate.fill(paymentDetails.date) await this.cardCVC.waitFor() await this.cardCVC.fill(paymentDetails.cvc) - } + completePayment = async () => { + await this.payButton.waitFor() + await this.payButton.click() + await this.page.waitForURL(/\/thank-you/, {timeout: 3000}) + } } \ No newline at end of file diff --git a/tests/new_user_full_journey.spec.js b/tests/new_user_full_journey.spec.js index 11f5fda..3024324 100644 --- a/tests/new_user_full_journey.spec.js +++ b/tests/new_user_full_journey.spec.js @@ -56,6 +56,7 @@ test.only("New user full end-to-end test journey", async ({page}) => { await paymentPage.activateDiscount() await paymentPage.fillPaymentDetails(paymentDetails) + await paymentPage.completePayment() // Hold