Add datagrid support in vouchers e2e tests (#4054)

This commit is contained in:
Paweł Chyła 2023-08-03 10:51:19 +02:00 committed by GitHub
parent 9037c9cfd1
commit 440f5e6674
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View file

@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---
Add datagrid support in vouchers e2e tests

View file

@ -10,11 +10,9 @@ import {
addPayment, addPayment,
createCheckoutWithVoucher, createCheckoutWithVoucher,
} from "../../../support/api/utils/ordersUtils"; } from "../../../support/api/utils/ordersUtils";
import * as productsUtils import * as productsUtils from "../../../support/api/utils/products/productsUtils";
from "../../../support/api/utils/products/productsUtils"; import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils";
import { import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas";
updateTaxConfigurationForChannel,
} from "../../../support/api/utils/taxesUtils";
import { import {
createVoucher, createVoucher,
discountOptions, discountOptions,
@ -166,7 +164,7 @@ describe("As an admin I want to create voucher", () => {
const voucherCode = `${startsWith}${faker.datatype.number()}`; const voucherCode = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest().visit(urlList.vouchers); cy.clearSessionData().loginUserViaRequest().visit(urlList.vouchers);
cy.expectSkeletonIsVisible(); ensureCanvasStatic();
createChannel({ name }).then(channel => { createChannel({ name }).then(channel => {
createdChannel = channel; createdChannel = channel;

View file

@ -1,10 +1,8 @@
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 { import { urlList, voucherDetailsUrl } from "../../../fixtures/urlList";
urlList,
voucherDetailsUrl,
} from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users"; import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas";
import { createCheckoutWithVoucher } from "../../api/utils/ordersUtils"; import { createCheckoutWithVoucher } from "../../api/utils/ordersUtils";
import { selectChannelInDetailsPages } from "../channelsPage"; import { selectChannelInDetailsPages } from "../channelsPage";
@ -103,7 +101,7 @@ export function loginAndCreateCheckoutForVoucherWithDiscount({
cy.clearSessionData() cy.clearSessionData()
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount)
.visit(urlList.vouchers); .visit(urlList.vouchers);
cy.expectSkeletonIsVisible(); ensureCanvasStatic();
createVoucher({ createVoucher({
voucherCode, voucherCode,
voucherValue, voucherValue,