diff --git a/.changeset/funny-zoos-run.md b/.changeset/funny-zoos-run.md new file mode 100644 index 00000000000..31fd0195eda --- /dev/null +++ b/.changeset/funny-zoos-run.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": minor +--- + +fixes e2e tests which fails on nightly run orders, apps, vouchers diff --git a/cypress/e2e/apps.js b/cypress/e2e/apps.js index 5d93877327c..274890f09fa 100644 --- a/cypress/e2e/apps.js +++ b/cypress/e2e/apps.js @@ -7,16 +7,9 @@ import { APP_DETAILS } from "../elements/apps/appDetails"; import { APPS_LIST_SELECTORS } from "../elements/apps/appsList"; import { WEBHOOK_DETAILS } from "../elements/apps/webhookDetails"; import { BUTTON_SELECTORS } from "../elements/shared/button-selectors"; -import { - appDetailsUrl, - urlList, -} from "../fixtures/urlList"; +import { appDetailsUrl, urlList } from "../fixtures/urlList"; import { ONE_PERMISSION_USERS } from "../fixtures/users"; -import { - createApp, - getApp, - updateApp, -} from "../support/api/requests/Apps"; +import { createApp, getApp, updateApp } from "../support/api/requests/Apps"; import { addShippingMethod, createCheckout, @@ -25,9 +18,7 @@ import { import { createVoucher } from "../support/api/requests/Discounts/Vouchers"; import { createGiftCard } from "../support/api/requests/GiftCard"; import { getDefaultChannel } from "../support/api/utils/channelsUtils"; -import { - getShippingMethodIdFromCheckout, -} from "../support/api/utils/ordersUtils"; +import { getShippingMethodIdFromCheckout } from "../support/api/utils/ordersUtils"; import { createProductInChannel, createTypeAttributeAndCategoryForProduct, @@ -148,7 +139,11 @@ describe("As a staff user I want to manage apps", () => { .get(WEBHOOK_DETAILS.nameInput) .type(randomWebhookName) .get(WEBHOOK_DETAILS.targetUrlInput) - .type(targetUrl) + .type(targetUrl); + cy.get(WEBHOOK_DETAILS.webhookObjects).first().click(); + cy.get(WEBHOOK_DETAILS.webhookEventsCheckboxes) + .first() + .click() .get(BUTTON_SELECTORS.confirm) .click() .confirmationMessageShouldDisappear(); diff --git a/cypress/e2e/discounts/vouchers/updateVouchers.js b/cypress/e2e/discounts/vouchers/updateVouchers.js index 71c1d6977dc..2bf959cf06e 100644 --- a/cypress/e2e/discounts/vouchers/updateVouchers.js +++ b/cypress/e2e/discounts/vouchers/updateVouchers.js @@ -6,21 +6,11 @@ import faker from "faker"; import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; import { voucherDetailsUrl } from "../../../fixtures/urlList"; -import { - createVoucherInChannel, -} from "../../../support/api/utils/discounts/vouchersUtils"; -import { - createCheckoutWithVoucher, -} from "../../../support/api/utils/ordersUtils"; -import * as productsUtils - from "../../../support/api/utils/products/productsUtils"; -import { - updateTaxConfigurationForChannel, -} from "../../../support/api/utils/taxesUtils"; -import { - formatDate, - formatTime, -} from "../../../support/formatData/formatDate"; +import { createVoucherInChannel } from "../../../support/api/utils/discounts/vouchersUtils"; +import { createCheckoutWithVoucher } from "../../../support/api/utils/ordersUtils"; +import * as productsUtils from "../../../support/api/utils/products/productsUtils"; +import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils"; +import { formatDate, formatTime } from "../../../support/formatData/formatDate"; import { setVoucherDate } from "../../../support/pages/discounts/vouchersPage"; describe("As an admin I want to update vouchers", () => { diff --git a/cypress/elements/apps/webhookDetails.js b/cypress/elements/apps/webhookDetails.js index f31022c3bfe..cbfadc437fd 100644 --- a/cypress/elements/apps/webhookDetails.js +++ b/cypress/elements/apps/webhookDetails.js @@ -1,4 +1,6 @@ export const WEBHOOK_DETAILS = { nameInput: '[name="name"]', - targetUrlInput: '[name="targetUrl"]' + targetUrlInput: '[name="targetUrl"]', + webhookObjects: '[data-test-id="webhook-objects-items"]', + webhookEventsCheckboxes: '[data-test-id="events-checkbox"]', }; diff --git a/cypress/support/api/requests/Channels.js b/cypress/support/api/requests/Channels.js index 8c204f4cc9a..54aa022fe86 100644 --- a/cypress/support/api/requests/Channels.js +++ b/cypress/support/api/requests/Channels.js @@ -98,8 +98,8 @@ export function updateChannelOrderSettings({ automaticallyFulfillNonShippableGiftCard: ${automaticallyFulfillNonShippableGiftCard}, expireOrdersAfter: ${expireOrdersAfter}, markAsPaidStrategy: ${markAsPaidStrategy}, - defaultTransactionFlowStrategy: ${defaultTransactionFlowStrategy} - }}){ + }paymentSettings:{ defaultTransactionFlowStrategy: ${defaultTransactionFlowStrategy} + }}){ errors{ field message diff --git a/cypress/support/pages/discounts/vouchersPage.js b/cypress/support/pages/discounts/vouchersPage.js index 1bd90b9c0e4..80f3d6db6c0 100644 --- a/cypress/support/pages/discounts/vouchersPage.js +++ b/cypress/support/pages/discounts/vouchersPage.js @@ -74,7 +74,7 @@ export function setVoucherDate({ } if (endDate) { if (hasEndDate) { - cy.get(VOUCHERS_SELECTORS.hasEndDateCheckbox).click(); + cy.get(VOUCHERS_SELECTORS.hasEndDateCheckbox).click({ force: true }); } cy.get(VOUCHERS_SELECTORS.endDateInput) .type(endDate) diff --git a/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx b/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx index 6e7cc27461e..42d0650ab76 100644 --- a/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx +++ b/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx @@ -120,6 +120,7 @@ const WebhookEvents: React.FC = ({ {Object.keys(EventTypes[tab]).map((object, idx) => ( setObject(object)} @@ -171,6 +172,7 @@ const WebhookEvents: React.FC = ({ )}