From 162121b757269c8b5685e4d1fd9eb70d029f0b09 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:01:54 +0200 Subject: [PATCH] fix: trying a new method for submit button --- tests/playwright/pages/CheckoutPageSFRA6.mjs | 3 ++- tests/playwright/pages/PaymentMethodsPage.mjs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/playwright/pages/CheckoutPageSFRA6.mjs b/tests/playwright/pages/CheckoutPageSFRA6.mjs index 5b51e99aa..10fdc8078 100644 --- a/tests/playwright/pages/CheckoutPageSFRA6.mjs +++ b/tests/playwright/pages/CheckoutPageSFRA6.mjs @@ -185,7 +185,8 @@ export default class CheckoutPageSFRA { submitPayment = async () => { await this.page.waitForLoadState('load', { timeout: 30000 }); - await expect(this.submitPaymentButton).toBeVisible({ timeout: 25000 }); + const submitButton = this.page.locator('button[value="submit-payment"]'); + await submitButton.waitFor({ state: 'visible', timeout: 30000 }); await this.submitPaymentButton.click(); }; diff --git a/tests/playwright/pages/PaymentMethodsPage.mjs b/tests/playwright/pages/PaymentMethodsPage.mjs index 9b71230b0..c52a8f057 100644 --- a/tests/playwright/pages/PaymentMethodsPage.mjs +++ b/tests/playwright/pages/PaymentMethodsPage.mjs @@ -235,6 +235,7 @@ export default class PaymentMethodsPage { const giftCardComponentWrapper = this.page.locator(".gift-card-selection"); await this.page.locator('#giftCardAddButton').click(); const giftCardSelect = this.page.locator("select[id='giftCardSelect']"); + await giftCardSelect.waitFor({ state: 'visible', timeout: 30000 }); await giftCardSelect.click(); await giftCardSelect.selectOption({ index: 0 }); const giftCardBrand = this.page.locator(`li[data-brand=${giftCardInput.brand}]`)