Skip to content

Commit

Permalink
Merge pull request #7 from spryker/bugfix/cc-33200-mp-retry-error
Browse files Browse the repository at this point in the history
Retry error.
  • Loading branch information
dmiseev authored Mar 28, 2024
2 parents 2000c24 + ca68e35 commit 78eac48
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 56 deletions.
24 changes: 18 additions & 6 deletions cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
mpAgentDashboardPage.find({ query: dynamicFixtures.merchantUser.username }).should('exist');
});

it('agent should be able to see/assist inactive merchant user in a table', (): void => {
it('agent should be able to see and assist inactive merchant user in a table', (): void => {
mpAgentLoginPage.visit();
mpAgentLoginPage.login({
username: dynamicFixtures.merchantAgentUser.username,
Expand All @@ -69,12 +69,14 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
mpAgentDashboardPage.find({ query: dynamicFixtures.deactivatedMerchantUser.username }).should('exist');

mpAgentDashboardPage.visit();
const alias = mpDashboardPage.interceptRequest();
mpAgentDashboardPage.assist({ query: dynamicFixtures.deactivatedMerchantUser.username });

cy.wait(`@${alias}`);
mpDashboardPage.assertPageLocation();
});

it('agent should be able to see/assist deleted merchant user in a table', (): void => {
it('agent should be able to see and assist deleted merchant user in a table', (): void => {
mpAgentLoginPage.visit();
mpAgentLoginPage.login({
username: dynamicFixtures.merchantAgentUser.username,
Expand All @@ -85,12 +87,14 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
mpAgentDashboardPage.find({ query: dynamicFixtures.deletedMerchantUser.username }).should('exist');

mpAgentDashboardPage.visit();
const alias = mpDashboardPage.interceptRequest();
mpAgentDashboardPage.assist({ query: dynamicFixtures.deletedMerchantUser.username });

cy.wait(`@${alias}`);
mpDashboardPage.assertPageLocation();
});

it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => {
it('agent should be able to see and assist merchant users from active (without approved access) merchant', (): void => {
mpAgentLoginPage.visit();
mpAgentLoginPage.login({
username: dynamicFixtures.merchantAgentUser.username,
Expand All @@ -101,12 +105,14 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
mpAgentDashboardPage.find({ query: dynamicFixtures.merchantUserFromActiveDeniedMerchant.username }).should('exist');

mpAgentDashboardPage.visit();
const alias = mpDashboardPage.interceptRequest();
mpAgentDashboardPage.assist({ query: dynamicFixtures.merchantUserFromActiveDeniedMerchant.username });

cy.wait(`@${alias}`);
mpDashboardPage.assertPageLocation();
});

it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => {
it('agent should be able to see and assist merchant users from inactive (with approved access) merchant', (): void => {
mpAgentLoginPage.visit();
mpAgentLoginPage.login({
username: dynamicFixtures.merchantAgentUser.username,
Expand All @@ -119,12 +125,14 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
.should('exist');

mpAgentDashboardPage.visit();
const alias = mpDashboardPage.interceptRequest();
mpAgentDashboardPage.assist({ query: dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username });

cy.wait(`@${alias}`);
mpDashboardPage.assertPageLocation();
});

it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => {
it('agent should be able to see and assist merchant users from inactive (without approved access) merchant', (): void => {
mpAgentLoginPage.visit();
mpAgentLoginPage.login({
username: dynamicFixtures.merchantAgentUser.username,
Expand All @@ -137,12 +145,14 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
.should('exist');

mpAgentDashboardPage.visit();
const alias = mpDashboardPage.interceptRequest();
mpAgentDashboardPage.assist({ query: dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username });

cy.wait(`@${alias}`);
mpDashboardPage.assertPageLocation();
});

it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => {
it('agent should be able to see and assist merchant users from active (with approved access) merchant', (): void => {
mpAgentLoginPage.visit();
mpAgentLoginPage.login({
username: dynamicFixtures.merchantAgentUser.username,
Expand All @@ -153,8 +163,10 @@ describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void =>
mpAgentDashboardPage.find({ query: dynamicFixtures.merchantUser.username }).should('exist');

mpAgentDashboardPage.visit();
const alias = mpDashboardPage.interceptRequest();
mpAgentDashboardPage.assist({ query: dynamicFixtures.merchantUser.username });

cy.wait(`@${alias}`);
mpDashboardPage.assertPageLocation();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,6 @@
"name": "haveCountry",
"key": "country"
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompany",
Expand All @@ -238,6 +226,18 @@
"key": "company2",
"arguments": [{ "isActive": true, "status": "approved" }]
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompanyBusinessUnit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,6 @@
"name": "haveCountry",
"key": "country"
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompany",
Expand All @@ -371,6 +359,18 @@
"key": "company2",
"arguments": [{ "isActive": true, "status": "approved" }]
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompanyBusinessUnit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,6 @@
"name": "haveCountry",
"key": "country"
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompany",
Expand All @@ -327,6 +315,18 @@
"key": "company2",
"arguments": [{ "isActive": true, "status": "approved" }]
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompanyBusinessUnit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,6 @@
"name": "haveCountry",
"key": "country"
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompany",
Expand All @@ -327,6 +315,18 @@
"key": "company2",
"arguments": [{ "isActive": true, "status": "approved" }]
},
{
"type": "helper",
"name": "haveCustomer",
"key": "customer",
"arguments": [{ "locale": "#localeEN", "password": "change123" }]
},
{
"type": "helper",
"name": "confirmCustomer",
"key": "confirmedCustomer",
"arguments": ["#customer"]
},
{
"type": "helper",
"name": "haveCompanyBusinessUnit",
Expand Down
7 changes: 6 additions & 1 deletion cypress/support/pages/mp/mp-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export class MpPage extends AbstractPage {
const interceptAlias = this.faker.string.uuid();

cy.intercept('GET', params.url).as(interceptAlias);
cy.wait(`@${interceptAlias}`).its('response.body.total').should('eq', expectedCount);
cy.wait(`@${interceptAlias}`)
.its('response.body.total')
.should((total) => {
const valueToBeAtMost = expectedCount + Cypress.currentRetry;
assert.isAtMost(total, valueToBeAtMost);
});
};
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"prettier:check": "prettier . --check",
"prettier:write": "prettier . --write",
"cy:open": "cypress open",
"cy:run": "cypress run --headless --browser chrome",
"cy:run": "cypress run",
"cy:ci": "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",
Expand Down

0 comments on commit 78eac48

Please sign in to comment.