From 049df7a3cb052887d7d012e0c7bb4a66ebed535b Mon Sep 17 00:00:00 2001 From: Artyom Jaksov Date: Tue, 22 Oct 2024 12:36:06 +0200 Subject: [PATCH] add timeouts --- tests/e2e/pages/mock-uk-bank-accounts-page.ts | 6 ++++-- tests/e2e/pages/payment-confirmation-page.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/e2e/pages/mock-uk-bank-accounts-page.ts b/tests/e2e/pages/mock-uk-bank-accounts-page.ts index 45fa99c..8e9e4ec 100644 --- a/tests/e2e/pages/mock-uk-bank-accounts-page.ts +++ b/tests/e2e/pages/mock-uk-bank-accounts-page.ts @@ -1,4 +1,4 @@ -import { Page } from '@playwright/test'; +import { expect, Page } from '@playwright/test'; export class MockUkBankAccountsPage { page: Page; @@ -8,11 +8,13 @@ export class MockUkBankAccountsPage { } // Locators + currentAccount = () => this.page.getByText('Select account'); continueButton = () => this.page.getByRole('button', { name: 'Continue' }); // Methods async selectAccountAndContinue() { - await this.continueButton().isVisible({timeout:10000}); + await expect(this.currentAccount()).toBeVisible({ timeout: 10000 }) + await this.continueButton().isVisible(); await this.continueButton().click({force: true}); } } \ No newline at end of file diff --git a/tests/e2e/pages/payment-confirmation-page.ts b/tests/e2e/pages/payment-confirmation-page.ts index 3689c87..63b583e 100644 --- a/tests/e2e/pages/payment-confirmation-page.ts +++ b/tests/e2e/pages/payment-confirmation-page.ts @@ -14,7 +14,7 @@ export class PaymentConfirmationPage { // Methods async waitForProcessingAndContinue() { - await expect(this.paymentProcessingText().or(this.paymentConfirmedText())).toBeVisible({timeout: 15000}) + await expect(this.paymentProcessingText().or(this.paymentConfirmedText())).toBeVisible({timeout: 20000}) await expect(this.continueButton()).toBeVisible(); await this.continueButton().click(); }