Skip to content

Commit

Permalink
Merge branch 'master' into feature/cc-32736/dev-merchant-relations
Browse files Browse the repository at this point in the history
  • Loading branch information
dmiseev committed Mar 27, 2024
2 parents f0c0f00 + 8a1d02d commit 154263d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('agent merchant portal', { tags: ['@marketplace-agent-assist'] }, (): v
});

productsPage.visit();
productsPage.find({ query: dynamicFixtures.productConcreteForMerchant.abstract_sku }).click();
productsPage.find({ query: dynamicFixtures.productConcreteForMerchant.abstract_sku }).click({ force: true });
productsPage.getDrawer().find(productsPage.getSaveButtonSelector()).click();

cy.get('body').contains('The Product is saved.');
Expand All @@ -96,7 +96,7 @@ describe('agent merchant portal', { tags: ['@marketplace-agent-assist'] }, (): v
});

offersPage.visit();
offersPage.find({ query: dynamicFixtures.productOffer.product_offer_reference }).click();
offersPage.find({ query: dynamicFixtures.productOffer.product_offer_reference }).click({ force: true });
offersPage.getDrawer().find(offersPage.getSaveButtonSelector()).click();

cy.get('body').contains('The Offer is saved.');
Expand Down
19 changes: 19 additions & 0 deletions cypress/support/pages/mp/dashboard/dashboard-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion cypress/support/pages/mp/sales/sales-orders-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class SalesOrdersPage extends MpPage {
};

cancel = (params: CancelParams): void => {
this.find({ query: params.query }).click();
this.find({ query: params.query }).click({ force: true });
this.repository.getDrawer().find(this.repository.getCancelButtonSelector()).click();
};
}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 154263d

Please sign in to comment.