Skip to content

Commit

Permalink
expect one of two possible messages
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom-jaksov-tl committed Oct 18, 2024
1 parent 76fbbad commit 660077c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/e2e/pages/payment-confirmation-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export class PaymentConfirmationPage {
}

// Locators
orderBeingProcessedText = () => this.page.getByText('Confirming your payment')
paymentConfirmedText = () => this.page.getByRole('heading', { name: 'All done' });
paymentProcessingText = () => this.page.getByText('In progress');
paymentConfirmedText = () => this.page.getByText('All done');
continueButton = () => this.page.getByRole('button', {name: 'continue'})

// Methods
async waitForProcessingAndContinue() {
// await expect(this.orderBeingProcessedText()).toBeVisible({timeout: 10000});
await expect(this.continueButton()).toBeVisible({timeout: 10000});
await expect(this.paymentProcessingText().or(this.paymentConfirmedText())).toBeVisible({timeout: 10000})
await expect(this.continueButton()).toBeVisible();
await this.continueButton().click();
}
}

0 comments on commit 660077c

Please sign in to comment.