From 053b2eb578243badba15dff68a8a0aa0ca5f0b91 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:22:29 +0100 Subject: [PATCH] fix: vipps wait for locator to be visible and add time for timeout after redirect --- tests/playwright/pages/CheckoutPageSFRA5.mjs | 2 +- tests/playwright/pages/CheckoutPageSFRA6.mjs | 2 +- tests/playwright/pages/PaymentMethodsPage.mjs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/playwright/pages/CheckoutPageSFRA5.mjs b/tests/playwright/pages/CheckoutPageSFRA5.mjs index ff4643b9b..4dc3e917c 100644 --- a/tests/playwright/pages/CheckoutPageSFRA5.mjs +++ b/tests/playwright/pages/CheckoutPageSFRA5.mjs @@ -205,7 +205,7 @@ export default class CheckoutPageSFRA5 { expectSuccess = async () => { await this.page.waitForNavigation({ url: /Order-Confirm/, - timeout: 15000, + timeout: 20000, }); await expect(this.thankYouMessage).toBeVisible({ timeout: 15000 }); }; diff --git a/tests/playwright/pages/CheckoutPageSFRA6.mjs b/tests/playwright/pages/CheckoutPageSFRA6.mjs index 0d0aa83d9..4054ac33c 100644 --- a/tests/playwright/pages/CheckoutPageSFRA6.mjs +++ b/tests/playwright/pages/CheckoutPageSFRA6.mjs @@ -221,7 +221,7 @@ export default class CheckoutPageSFRA { expectSuccess = async () => { await this.page.waitForNavigation({ url: /Order-Confirm/, - timeout: 15000, + timeout: 20000, }); await expect(this.thankYouMessage).toBeVisible({ timeout: 15000 }); }; diff --git a/tests/playwright/pages/PaymentMethodsPage.mjs b/tests/playwright/pages/PaymentMethodsPage.mjs index 6dc45d591..441a5091d 100644 --- a/tests/playwright/pages/PaymentMethodsPage.mjs +++ b/tests/playwright/pages/PaymentMethodsPage.mjs @@ -11,7 +11,7 @@ export default class PaymentMethodsPage { } getLocation = async () => { - await this.page.waitForNavigation('load', { timeout: 15000 }); + await this.page.waitForNavigation('load', { timeout: 20000 }); return await this.page.url(); }; @@ -505,6 +505,7 @@ export default class PaymentMethodsPage { }; cancelVippsPayment = async () => { + await expect(this.page.locator('.cancel-link')).toBeVisible({ timeout: 15000 }); await this.page.click('.cancel-link'); };