diff --git a/Dockerfile b/Dockerfile index 17227a14..c7cf4328 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Start the final image -FROM cypress/browsers:latest +FROM cypress/browsers:node-20.11.1-chrome-123.0.6312.58-1-ff-124.0-edge-122.0.2365.92-1 # Set and create the working directory ENV CYPRESS_TESTS_WORK_DIR /opt/cypress-tests diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts index bfffbdd4..c6a5f86e 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts @@ -65,8 +65,9 @@ describe('agent impersonation', { tags: ['@marketplace-agent-assist'] }, (): voi mpAgentDashboardPage.assertPageLocation(); // Ensure that agent finished assistant session and don't have access to MP dashboard + const alias = mpDashboardPage.interceptRequest(); mpDashboardPage.visit({ failOnStatusCode: false }); - cy.get('body').contains('Access Denied.'); + mpDashboardPage.assert500StatusCode({ alias: alias }); }); it('agent should be able to fully logout from all sessions', (): void => { diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts index a3863ac5..56825eba 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts @@ -81,7 +81,7 @@ describe('agent merchant portal', { tags: ['@marketplace-agent-assist'] }, (): v ); productsPage.visit(); - productsPage.findProduct(dynamicFixtures.productConcreteForMerchant.abstract_sku).click(); + productsPage.findProduct(dynamicFixtures.productConcreteForMerchant.abstract_sku).click({ force: true }); productsPage.getDrawer().find('button:contains("Save")').click(); cy.get('body').contains('The Product is saved.'); @@ -95,7 +95,7 @@ describe('agent merchant portal', { tags: ['@marketplace-agent-assist'] }, (): v ); offersPage.visit(); - offersPage.findOffer(dynamicFixtures.productOffer.product_offer_reference).click(); + offersPage.findOffer(dynamicFixtures.productOffer.product_offer_reference).click({ force: true }); offersPage.getDrawer().find('button:contains("Save")').click(); cy.get('body').contains('The Offer is saved.'); diff --git a/cypress/support/pages/mp/dashboard/dashboard-page.ts b/cypress/support/pages/mp/dashboard/dashboard-page.ts index bb158461..e9bc0432 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-page.ts @@ -15,4 +15,23 @@ export class DashboardPage extends MpPage { this.repository.getUserProfileMenu().click(); this.repository.getLogoutButton().click(); }; + + interceptRequest = (): string => { + const alias = 'dashboardPageRequest'; + cy.intercept({ url: this.PAGE_URL }).as(alias); + + return alias; + }; + + assert500StatusCode = (params: Assert500StatusCodeParams): void => { + cy.wait(`@${params.alias}`).then((interception) => { + if (interception.response) { + expect(interception.response.statusCode).to.equal(500); + } + }); + }; +} + +interface Assert500StatusCodeParams { + alias: string; } diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index 65000cbf..6c7794b9 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -24,7 +24,7 @@ export class SalesOrdersPage extends MpPage { }; cancelOrder = (query: string): void => { - this.findOrder(query).click(); + this.findOrder(query).click({ force: true }); this.repository.getDrawer().find('button:contains("Cancel")').click(); }; } diff --git a/package.json b/package.json index 70691268..a6af1757 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,11 @@ "prettier:check": "prettier . --check", "prettier:write": "prettier . --write", "cy:open": "cypress open", - "cy:run": "cypress run --headless --browser electron", - "cy:yves": "cypress run --spec cypress/e2e/yves/* --headless --browser electron", - "cy:backoffice": "cypress run --spec cypress/e2e/backoffice/* --headless --browser electron", - "cy:mp": "cypress run --spec cypress/e2e/mp/* --headless --browser electron", - "cy:feature:comments": "cypress run --env grepTags=@comments --headless --browser electron" + "cy:run": "cypress run --headless --browser chrome", + "cy:yves": "cypress run --spec cypress/e2e/yves/* --headless --browser chrome", + "cy:backoffice": "cypress run --spec cypress/e2e/backoffice/* --headless --browser chrome", + "cy:mp": "cypress run --spec cypress/e2e/mp/* --headless --browser chrome", + "cy:feature:comments": "cypress run --env grepTags=@comments --headless --browser chrome" }, "engines": { "node": ">=18.0.0",