diff --git a/cypress/elements/dashboard/dashboard-selectors.js b/cypress/elements/dashboard/dashboard-selectors.js index ad81a2ad8..40cc039fe 100644 --- a/cypress/elements/dashboard/dashboard-selectors.js +++ b/cypress/elements/dashboard/dashboard-selectors.js @@ -5,6 +5,5 @@ export const DASHBOARD_SELECTORS = { topProducts: "[data-test-id='top-products']", ordersReadyToFulfill: "[data-test-id='orders-to-fulfill']", paymentsWaitingForCapture: "[data-test-id='orders-to-capture']", - productsOutOfStock: "[data-test-id='products-out-of-stock']", - dataAreLoading: "[class*='Skeleton-skeleton']" + productsOutOfStock: "[data-test-id='products-out-of-stock']" }; diff --git a/cypress/integration/dashboard.js b/cypress/integration/dashboard.js index 35ed23989..c9983d820 100644 --- a/cypress/integration/dashboard.js +++ b/cypress/integration/dashboard.js @@ -130,24 +130,14 @@ describe("User authorization", () => { .get(HEADER_SELECTORS.channelSelectList) .contains(randomName) .click() - .waitForGraph("Home") - .then(() => { - cy.get(DASHBOARD_SELECTORS.dataAreLoading) - .should("not.exist") - .then(() => { - const regex = /^1\D+/; - cy.softAssertMatch(DASHBOARD_SELECTORS.ordersReadyToFulfill, regex) - .softAssertMatch( - DASHBOARD_SELECTORS.paymentsWaitingForCapture, - regex - ) - .softAssertMatch(DASHBOARD_SELECTORS.productsOutOfStock, regex) - .softAssertMatch( - DASHBOARD_SELECTORS.sales, - new RegExp(`\\D+${sales}[\,.]00\\D*`) - ) - .softAssertMatch(DASHBOARD_SELECTORS.orders, /\D+2\D*/); - }); - }); + .waitForGraph("Home"); + const salesRegexp = new RegExp(`\\D+${sales}[\,.]00\\D*`); + cy.contains(salesRegexp).should("be.visible"); + const regex = /^1\D+/; + cy.softAssertMatch(DASHBOARD_SELECTORS.ordersReadyToFulfill, regex) + .softAssertMatch(DASHBOARD_SELECTORS.paymentsWaitingForCapture, regex) + .softAssertMatch(DASHBOARD_SELECTORS.productsOutOfStock, regex) + .softAssertMatch(DASHBOARD_SELECTORS.sales, salesRegexp) + .softAssertMatch(DASHBOARD_SELECTORS.orders, /\D+2\D*/); }); });