diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts index 7bb00339..81b4aca4 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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(); }); }); diff --git a/cypress/fixtures/suite/backoffice/merchant-b2b-contract-requests/dynamic-request-management.json b/cypress/fixtures/suite/backoffice/merchant-b2b-contract-requests/dynamic-request-management.json index f2bb3a78..c7832f35 100644 --- a/cypress/fixtures/suite/backoffice/merchant-b2b-contract-requests/dynamic-request-management.json +++ b/cypress/fixtures/suite/backoffice/merchant-b2b-contract-requests/dynamic-request-management.json @@ -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", @@ -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", diff --git a/cypress/fixtures/suite/mp/merchant-b2b-contract-requests/dynamic-request-management.json b/cypress/fixtures/suite/mp/merchant-b2b-contract-requests/dynamic-request-management.json index 00467923..620490f5 100644 --- a/cypress/fixtures/suite/mp/merchant-b2b-contract-requests/dynamic-request-management.json +++ b/cypress/fixtures/suite/mp/merchant-b2b-contract-requests/dynamic-request-management.json @@ -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", @@ -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", diff --git a/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-creation.json b/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-creation.json index 0660af56..75835843 100644 --- a/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-creation.json +++ b/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-creation.json @@ -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", @@ -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", diff --git a/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-management.json b/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-management.json index 0a6e5ca5..46676b6b 100644 --- a/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-management.json +++ b/cypress/fixtures/suite/yves/merchant-b2b-contract-requests/dynamic-request-management.json @@ -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", @@ -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", diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts index 7a9f444e..235bbab5 100644 --- a/cypress/support/pages/mp/mp-page.ts +++ b/cypress/support/pages/mp/mp-page.ts @@ -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); + }); }; } diff --git a/package.json b/package.json index be74794f..1896e6d3 100644 --- a/package.json +++ b/package.json @@ -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",