Skip to content

Commit

Permalink
fix(e2e): Stripe tests and others
Browse files Browse the repository at this point in the history
  • Loading branch information
sashko9807 committed Jul 1, 2024
1 parent 9486364 commit b020517
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 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
4 changes: 2 additions & 2 deletions e2e/tests/regression/campaign-flow/campaign-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ 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 () => {
await page.close()
})

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 b020517

Please sign in to comment.