test - fix vouchers tests (#3832)
This commit is contained in:
parent
3123f04c69
commit
5eb6888c42
1 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,9 @@
|
||||||
import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers";
|
import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers";
|
||||||
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
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 { ONE_PERMISSION_USERS } from "../../../fixtures/users";
|
||||||
import { createCheckoutWithVoucher } from "../../api/utils/ordersUtils";
|
import { createCheckoutWithVoucher } from "../../api/utils/ordersUtils";
|
||||||
import { selectChannelInDetailsPages } from "../channelsPage";
|
import { selectChannelInDetailsPages } from "../channelsPage";
|
||||||
|
@ -29,7 +32,9 @@ export function createVoucher({
|
||||||
.get(discountOption)
|
.get(discountOption)
|
||||||
.click();
|
.click();
|
||||||
if (discountOption !== discountOptions.SHIPPING) {
|
if (discountOption !== discountOptions.SHIPPING) {
|
||||||
cy.get(VOUCHERS_SELECTORS.discountValueInputs).type(voucherValue);
|
cy.get(VOUCHERS_SELECTORS.discountValueInputs).type(voucherValue, {
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (usageLimit) {
|
if (usageLimit) {
|
||||||
cy.get(VOUCHERS_SELECTORS.limits.usageLimitCheckbox)
|
cy.get(VOUCHERS_SELECTORS.limits.usageLimitCheckbox)
|
||||||
|
@ -54,9 +59,7 @@ export function createVoucher({
|
||||||
.get(VOUCHERS_SELECTORS.requirements.minCheckoutItemsQuantityInput)
|
.get(VOUCHERS_SELECTORS.requirements.minCheckoutItemsQuantityInput)
|
||||||
.type(minAmountOfItems);
|
.type(minAmountOfItems);
|
||||||
}
|
}
|
||||||
cy.get(BUTTON_SELECTORS.confirm)
|
cy.get(BUTTON_SELECTORS.confirm).click().confirmationMessageShouldAppear();
|
||||||
.click()
|
|
||||||
.confirmationMessageShouldAppear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setVoucherDate({
|
export function setVoucherDate({
|
||||||
|
|
Loading…
Reference in a new issue