From 5eb6888c4283563e6ee1bcaf12e41327ba7ed6db Mon Sep 17 00:00:00 2001 From: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com> Date: Fri, 30 Jun 2023 14:02:37 +0200 Subject: [PATCH] test - fix vouchers tests (#3832) --- cypress/support/pages/discounts/vouchersPage.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cypress/support/pages/discounts/vouchersPage.js b/cypress/support/pages/discounts/vouchersPage.js index 3b4f52689..dbe8c9b01 100644 --- a/cypress/support/pages/discounts/vouchersPage.js +++ b/cypress/support/pages/discounts/vouchersPage.js @@ -1,6 +1,9 @@ import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { urlList, voucherDetailsUrl } from "../../../fixtures/urlList"; +import { + urlList, + voucherDetailsUrl, +} from "../../../fixtures/urlList"; import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; import { createCheckoutWithVoucher } from "../../api/utils/ordersUtils"; import { selectChannelInDetailsPages } from "../channelsPage"; @@ -29,7 +32,9 @@ export function createVoucher({ .get(discountOption) .click(); if (discountOption !== discountOptions.SHIPPING) { - cy.get(VOUCHERS_SELECTORS.discountValueInputs).type(voucherValue); + cy.get(VOUCHERS_SELECTORS.discountValueInputs).type(voucherValue, { + force: true, + }); } if (usageLimit) { cy.get(VOUCHERS_SELECTORS.limits.usageLimitCheckbox) @@ -54,9 +59,7 @@ export function createVoucher({ .get(VOUCHERS_SELECTORS.requirements.minCheckoutItemsQuantityInput) .type(minAmountOfItems); } - cy.get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldAppear(); + cy.get(BUTTON_SELECTORS.confirm).click().confirmationMessageShouldAppear(); } export function setVoucherDate({