diff --git a/tests/playwright/fixtures/USD.spec.mjs b/tests/playwright/fixtures/USD.spec.mjs index 62507573f..78e127f39 100644 --- a/tests/playwright/fixtures/USD.spec.mjs +++ b/tests/playwright/fixtures/USD.spec.mjs @@ -265,7 +265,7 @@ for (const environment of environments) { await redirectShopper.doPayPalPayment(true, false, true); if (environment.name.indexOf('v5') !== -1) { await page.locator("button[value='place-order']").click(); - await page.locator(".order-thank-you-msg").isVisible({timeout: 20000}); + await page.locator(".order-thank-you-msg").isVisible(); } else { await checkoutPage.expectSuccess(); } @@ -279,7 +279,7 @@ for (const environment of environments) { await redirectShopper.doPayPalPayment(true, true, true); if (environment.name.indexOf('v5') !== -1) { await page.locator("button[value='place-order']").click(); - await page.locator(".order-thank-you-msg").isVisible({timeout: 20000}); + await page.locator(".order-thank-you-msg").isVisible(); } else { await checkoutPage.expectSuccess(); } diff --git a/tests/playwright/pages/AccountPageSFRA.mjs b/tests/playwright/pages/AccountPageSFRA.mjs index 32fd561cb..cea59ef19 100644 --- a/tests/playwright/pages/AccountPageSFRA.mjs +++ b/tests/playwright/pages/AccountPageSFRA.mjs @@ -28,7 +28,7 @@ export default class AccountPageSFRA { .locator('.input-field') .type(cardInput.cvc); } - await this.page.waitForLoadState('networkidle', { timeout: 20000 }); + await this.page.waitForLoadState('networkidle'); await this.page.click('button[name="save"]'); }; @@ -41,7 +41,7 @@ export default class AccountPageSFRA { const cardElement = this.savedCardElementGenerator(cardData); const deleteButton = cardElement.locator('../../button'); - await this.page.waitForLoadState('networkidle', { timeout: 20000 }); + await this.page.waitForLoadState('networkidle'); await deleteButton.click(); await this.page.click('.delete-confirmation-btn'); @@ -52,7 +52,6 @@ export default class AccountPageSFRA { await cardElement.waitFor({ state: 'visible', - timeout: 20000, }); }; diff --git a/tests/playwright/pages/CheckoutPageSFRA5.mjs b/tests/playwright/pages/CheckoutPageSFRA5.mjs index b6733efb9..c13c526f9 100644 --- a/tests/playwright/pages/CheckoutPageSFRA5.mjs +++ b/tests/playwright/pages/CheckoutPageSFRA5.mjs @@ -88,7 +88,7 @@ export default class CheckoutPageSFRA5 { isPaymentModalShown = async (imgAltValue) => { await expect(this.paymentModal.locator(`img[alt='${imgAltValue}']`)) - .toBeVisible({ timeout: 20000 }); + .toBeVisible(); } navigateToCheckout = async (locale) => { @@ -101,7 +101,7 @@ export default class CheckoutPageSFRA5 { goToCheckoutPageWithFullCart = async (locale, itemCount = 1) => { await this.addProductToCart(locale, itemCount); - await this.successMessage.waitFor({ visible: true, timeout: 20000 }); + await this.successMessage.waitFor({ visible: true }); await this.navigateToCheckout(locale); await this.checkoutGuest.click(); @@ -175,11 +175,11 @@ export default class CheckoutPageSFRA5 { }; submitPayment = async () => { - await this.page.waitForLoadState('load', { timeout: 30000 }); + await this.page.waitForLoadState('load'); await this.submitPaymentButton.click(); }; placeOrder = async () => { - await this.page.waitForLoadState('load', { timeout: 30000 }); + await this.page.waitForLoadState('load'); await this.placeOrderButton.click(); }; @@ -193,7 +193,7 @@ export default class CheckoutPageSFRA5 { }; goBackAndSubmitShipping = async () => { - await this.page.waitForNavigation('load', { timeout: 20000 }); + await this.page.waitForNavigation('load'); await this.navigateBack(); await this.submitShipping(); }; @@ -203,25 +203,25 @@ export default class CheckoutPageSFRA5 { url: /Order-Confirm/, timeout: 20000, }); - await expect(this.thankYouMessage).toBeVisible({ timeout: 20000 }); + await expect(this.thankYouMessage).toBeVisible(); }; expectNonRedirectSuccess = async () => { - await expect(this.thankYouMessage).toBeVisible({ timeout: 20000 }); + await expect(this.thankYouMessage).toBeVisible(); }; expectRefusal = async () => { - await expect(this.errorMessage).not.toBeEmpty({ timeout: 25000 }); + await expect(this.errorMessage).not.toBeEmpty(); }; expectVoucher = async () => { - await expect(this.voucherCode).toBeVisible({ timeout: 20000 }); + await expect(this.voucherCode).toBeVisible(); }; expectQRcode = async () => { - await this.qrLoader.waitFor({ state: 'attached', timeout: 20000 }); - await expect(this.qrLoaderAmount).toBeVisible({ timeout: 20000 }); - await expect(this.qrImg).toBeVisible({ timeout: 20000 }); + await this.qrLoader.waitFor({ state: 'attached'}); + await expect(this.qrLoaderAmount).toBeVisible(); + await expect(this.qrImg).toBeVisible(); }; expectGiftCardWarning = async () => { diff --git a/tests/playwright/pages/CheckoutPageSFRA6.mjs b/tests/playwright/pages/CheckoutPageSFRA6.mjs index 8e6e33617..4d40f69cd 100644 --- a/tests/playwright/pages/CheckoutPageSFRA6.mjs +++ b/tests/playwright/pages/CheckoutPageSFRA6.mjs @@ -89,7 +89,7 @@ export default class CheckoutPageSFRA { isPaymentModalShown = async (imgAltValue) => { await expect(this.paymentModal.locator(`img[alt='${imgAltValue}']`)) - .toBeVisible({ timeout: 20000 }); + .toBeVisible(); } navigateToCheckout = async (locale) => { @@ -102,7 +102,7 @@ export default class CheckoutPageSFRA { goToCheckoutPageWithFullCart = async (locale, itemCount = 1, email) => { await this.addProductToCart(locale, itemCount); - await this.successMessage.waitFor({ visible: true, timeout: 20000 }); + await this.successMessage.waitFor({ visible: true }); await this.navigateToCheckout(locale); await this.setEmail(email); @@ -127,7 +127,7 @@ export default class CheckoutPageSFRA { }; setShopperDetails = async (shopperDetails) => { - await this.customerInfoSection.waitFor({ visible: true, timeout: 20000 }); + await this.customerInfoSection.waitFor({ visible: true }); await this.checkoutPageUserFirstNameInput.type( @@ -216,27 +216,26 @@ export default class CheckoutPageSFRA { expectSuccess = async () => { await this.page.waitForNavigation({ url: /Order-Confirm/, - timeout: 20000, }); - await expect(this.thankYouMessage).toBeVisible({ timeout: 20000 }); + await expect(this.thankYouMessage).toBeVisible(); }; expectNonRedirectSuccess = async () => { - await expect(this.thankYouMessage).toBeVisible({ timeout: 20000 }); + await expect(this.thankYouMessage).toBeVisible(); }; expectRefusal = async () => { - await expect(this.errorMessage).not.toBeEmpty({ timeout: 25000 }); + await expect(this.errorMessage).not.toBeEmpty(); }; expectVoucher = async () => { - await expect(this.voucherCode).toBeVisible({ timeout: 20000 }); + await expect(this.voucherCode).toBeVisible(); }; expectQRcode = async () => { await this.qrLoader.waitFor({ state: 'attached', timeout: 20000 }); - await expect(this.qrLoaderAmount).toBeVisible({ timeout: 20000 }); - await expect(this.qrImg).toBeVisible({ timeout: 20000 }); + await expect(this.qrLoaderAmount).toBeVisible(); + await expect(this.qrImg).toBeVisible(); }; expectGiftCardWarning = async () => { diff --git a/tests/playwright/pages/PaymentMethodsPage.mjs b/tests/playwright/pages/PaymentMethodsPage.mjs index 28c57b8f9..071b596ba 100644 --- a/tests/playwright/pages/PaymentMethodsPage.mjs +++ b/tests/playwright/pages/PaymentMethodsPage.mjs @@ -46,7 +46,7 @@ export default class PaymentMethodsPage { // Capture popup for interaction const [popup] = await Promise.all([ - this.page.waitForEvent('popup', { timeout: 30000 }), + this.page.waitForEvent('popup'), payPalButton.click({ timeout: 40000 }), ]); @@ -83,7 +83,7 @@ export default class PaymentMethodsPage { else { await this.cancelButton.click(); await this.page.goBack(); - await expect(this.page.locator('.add-to-cart'),).toBeVisible({ timeout: 20000 }); + await expect(this.page.locator('.add-to-cart'),).toBeVisible(); } }; @@ -95,7 +95,7 @@ export default class PaymentMethodsPage { if (normalFlow) { await this.page.click("#rb_amazonpay"); } - await this.page.waitForLoadState('domcontentloaded', { timeout: 20000 }); + await this.page.waitForLoadState('domcontentloaded', { timeout: 30000 }); await this.page.click(".adyen-checkout__amazonpay__button"); // Amazon Sandbox selectors @@ -111,7 +111,7 @@ export default class PaymentMethodsPage { await this.passwordInput.click(); await this.passwordInput.type(paymentData.AmazonPay.password); await this.loginButton.click(); - await this.page.waitForLoadState("networkidle", { timeout: 20000 }); + await this.page.waitForLoadState("networkidle", { timeout: 30000 }); if (await this.amazonCaptcha.isVisible()){ return false; @@ -357,7 +357,7 @@ export default class PaymentMethodsPage { waitForKlarnaLoad = async () => { await this.page.waitForNavigation({ url: /.*playground.klarna/, - timeout: 25000, + timeout: 30000, waitUntil: 'load', }); }; @@ -365,14 +365,14 @@ export default class PaymentMethodsPage { // Generic function to be used for simulating the redirect waitForRedirect = async () => { await this.page.waitForNavigation({ - timeout: 20000, + timeout: 30000, waitUntil: 'load', }); }; async continueOnKlarna(skipModal) { await this.waitForKlarnaLoad(); - await this.page.waitForLoadState('networkidle', { timeout: 25000 }); + await this.page.waitForLoadState('networkidle', { timeout: 30000 }); this.klarnaIframe = this.page.frameLocator( '#klarna-apf-iframe', ); @@ -385,7 +385,7 @@ export default class PaymentMethodsPage { await this.klarnaContinueButton.click(); await this.klarnaVerificationCodeInput.waitFor({ state: 'visible', - timeout: 25000, + timeout: 30000, }); await this.klarnaVerificationCodeInput.fill('123456'); if (this.klarnaSelectPlanButton.isVisible() && !skipModal) { @@ -394,7 +394,7 @@ export default class PaymentMethodsPage { } await this.klarnaBuyButton.waitFor({ state: 'visible', - timeout: 25000, + timeout: 30000, }); await this.klarnaBuyButton.click(); } @@ -444,10 +444,10 @@ export default class PaymentMethodsPage { '#invoice_kp-invoice-payment-method', ); - await this.page.waitForNavigation('networkidle', { timeout: 20000 }); - await this.klarnaPaymentMethodGroup.waitFor('visible', { timeout: 20000 }); - await this.page.waitForLoadState('networkidle', { timeout: 20000 }); - await this.klarnaBuyButton.waitFor('visible', { timeout: 20000 }); + await this.page.waitForNavigation('networkidle', { timeout: 30000 }); + await this.klarnaPaymentMethodGroup.waitFor('visible', { timeout: 30000 }); + await this.page.waitForLoadState('networkidle', { timeout: 30000 }); + await this.klarnaBuyButton.waitFor('visible', { timeout: 30000 }); await this.klarnaBuyButton.click(); await this.klarnaIdNumberField.fill('811228-9874'); @@ -456,7 +456,7 @@ export default class PaymentMethodsPage { cancelKlarnaPayment = async () => { await this.waitForKlarnaLoad(); - await this.page.waitForLoadState('networkidle', { timeout: 25000 }); + await this.page.waitForLoadState('networkidle', { timeout: 30000 }); this.cancelButton = this.page.locator("button[title='Close']"); await this.cancelButton.click(); await this.page.click("button[id='payment-cancel-dialog-express__confirm']"); @@ -468,8 +468,8 @@ export default class PaymentMethodsPage { const backButton = this.page.locator("button[name='backLink']"); await rejectCookies.click(); - await giroBankDropdown.waitFor({ state: 'visible', timeout: 20000 }); - await backButton.waitFor({ state: 'visible', timeout: 20000 }); + await giroBankDropdown.waitFor({ state: 'visible', timeout: 30000 }); + await backButton.waitFor({ state: 'visible', timeout: 30000 }); await backButton.click(); };