From b020517481eb743553ef9b23cdd14a8b2bb74d36 Mon Sep 17 00:00:00 2001 From: Alexander Petkov Date: Mon, 1 Jul 2024 12:17:21 +0300 Subject: [PATCH] fix(e2e): Stripe tests and others --- e2e/pages/web-pages/base.page.ts | 4 ++-- e2e/pages/web-pages/external/stripe-checkout.page.ts | 7 +++---- e2e/tests/regression/campaign-flow/campaign-view.spec.ts | 4 ++-- .../regression/donation-flow/anon-donation-fixed.spec.ts | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/e2e/pages/web-pages/base.page.ts b/e2e/pages/web-pages/base.page.ts index 8fe3dcef3..858cbe7d0 100644 --- a/e2e/pages/web-pages/base.page.ts +++ b/e2e/pages/web-pages/base.page.ts @@ -290,9 +290,9 @@ export class BasePage { await this.clearInputFieldBySelector(elementSelector) } if (slowTyping) { - await this.page.type(elementSelector, inputValueToFill.toString().trim(), { delay: 100 }) + await this.page.fill(elementSelector, inputValueToFill.toString().trim()) } else { - await this.page.type(elementSelector, inputValueToFill.toString().trim()) + await this.page.fill(elementSelector, inputValueToFill.toString().trim()) } if (pressEnterKey) { await this.page.press(elementSelector, 'Enter') diff --git a/e2e/pages/web-pages/external/stripe-checkout.page.ts b/e2e/pages/web-pages/external/stripe-checkout.page.ts index 8505acbea..ba0a7d7db 100644 --- a/e2e/pages/web-pages/external/stripe-checkout.page.ts +++ b/e2e/pages/web-pages/external/stripe-checkout.page.ts @@ -9,10 +9,9 @@ export class StripeCheckoutPage extends BasePage { private readonly productSummaryTotalAmount = '#ProductSummary-totalAmount span' private readonly checkoutPaymentForm = '.CheckoutPaymentForm' private readonly emailReadonlyInputField = this.checkoutPaymentForm + ' .ReadOnlyFormField-title' - private readonly cardNumberFieldSet = this.checkoutPaymentForm + ' #cardNumber-fieldset' - private readonly cardNumberInputField = this.cardNumberFieldSet + ' #cardNumber' - private readonly cardExpDateInputField = this.cardNumberFieldSet + ' #cardExpiry' - private readonly cardCvcInputField = this.cardNumberFieldSet + ' #cardCvc' + private readonly cardNumberInputField = this.checkoutPaymentForm + ' #cardNumber' + private readonly cardExpDateInputField = this.checkoutPaymentForm + ' #cardExpiry' + private readonly cardCvcInputField = this.checkoutPaymentForm + ' #cardCvc' private readonly billingNameInputField = this.checkoutPaymentForm + ' #billingName' private readonly billingCountryDropdown = this.checkoutPaymentForm + ' #billingCountry' private readonly submitPayButton = this.checkoutPaymentForm + ' button.SubmitButton' diff --git a/e2e/tests/regression/campaign-flow/campaign-view.spec.ts b/e2e/tests/regression/campaign-flow/campaign-view.spec.ts index 646587b02..f9f2048e9 100644 --- a/e2e/tests/regression/campaign-flow/campaign-view.spec.ts +++ b/e2e/tests/regression/campaign-flow/campaign-view.spec.ts @@ -28,7 +28,7 @@ test.describe.serial( // For local executions use method navigateToLocalhostHomepage(); // await homepage.navigateToLocalhostHomepage(); await homepage.navigateToEnvHomepage() - // await headerPage.changeLanguageToBe(LanguagesEnum.BG) + await headerPage.changeLanguageToBe(LanguagesEnum.EN) }) test.afterAll(async () => { @@ -36,7 +36,7 @@ test.describe.serial( }) test('Particular campaign can be opened through the Campaign page', async () => { - await headerPage.clickDonateHeaderNavButton() + await headerPage.clickDonateHeaderNavButton(LanguagesEnum.EN) await campaignsPage.clickCampaignCardByIndex(0) expect( diff --git a/e2e/tests/regression/donation-flow/anon-donation-fixed.spec.ts b/e2e/tests/regression/donation-flow/anon-donation-fixed.spec.ts index 005d9557f..7aa77e06b 100644 --- a/e2e/tests/regression/donation-flow/anon-donation-fixed.spec.ts +++ b/e2e/tests/regression/donation-flow/anon-donation-fixed.spec.ts @@ -42,7 +42,7 @@ test.describe.serial( }) test('Particular campaign can be opened through the Campaign page', async () => { - await headerPage.clickDonateHeaderNavButton() + await headerPage.clickDonateHeaderNavButton(LanguagesEnum.EN) await campaignsPage.clickCampaignCardByIndex(0) // We move from the common Campaigns page to the particular campain page // check if the url is changed only based on the url pattern http://localhost:3040/campaigns/{slug-based-regexp}