Skip to content

Commit

Permalink
tests(e2e): Fix Stripe checkout tests and others (#1868)
Browse files Browse the repository at this point in the history
For some reason this suddenly broke the e2e tests. This change should fix the issue

-Resolved Stripe Checkout session e2e not passing
-Resolved tests on English not passing
  • Loading branch information
sashko9807 authored Jul 1, 2024
1 parent 8c6e1a0 commit 14bf0b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions e2e/pages/web-pages/base.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 3 additions & 4 deletions e2e/pages/web-pages/external/stripe-checkout.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/regression/campaign-flow/campaign-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 14bf0b7

Please sign in to comment.