diff --git a/.env-cmdrc b/.env-cmdrc index aeb0f17cde2..17da19ac68a 100644 --- a/.env-cmdrc +++ b/.env-cmdrc @@ -1,6 +1,6 @@ { "dev": { - "CX_BASE_URL": "https://40.76.109.9:9002" + "CX_BASE_URL": "https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud" }, "local": { "CX_BASE_URL": "https://localhost:9002" @@ -9,7 +9,7 @@ "CX_BASE_URL": "http://localhost:9002" }, "ci": { - "CX_BASE_URL": "https://20.83.184.244:9002" + "CX_BASE_URL": "https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud" }, "ccv2": { "CX_BASE_URL": "https://api.cg79x9wuu9-eccommerc1-p1-public.model-t.myhybris.cloud" diff --git a/ci-scripts/e2e-cypress.sh b/ci-scripts/e2e-cypress.sh index 4b8bf57faa4..f409711eb48 100755 --- a/ci-scripts/e2e-cypress.sh +++ b/ci-scripts/e2e-cypress.sh @@ -103,13 +103,13 @@ else echo '-----' echo "Running Cypress end to end tests" - if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then - if [[ "${GITHUB_HEAD_REF}" == epic/* ]]; then +# if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then +# if [[ "${GITHUB_HEAD_REF}" == epic/* ]]; then +# npm run e2e:run:ci"${SUITE}" +# else +# npm run e2e:run:ci:core"${SUITE}" +# fi +# else npm run e2e:run:ci"${SUITE}" - else - npm run e2e:run:ci:core"${SUITE}" - fi - else - npm run e2e:run:ci"${SUITE}" - fi +# fi fi diff --git a/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts b/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts index e0501519ffd..e096aaf6c6f 100644 --- a/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts +++ b/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts @@ -20,7 +20,8 @@ export default defineConfig({ }, videoUploadOnPasses: false, env: { - API_URL: 'https://20.83.184.244:9002', + API_URL: + 'https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud', BASE_SITE: 'electronics-spa', BASE_LANG: 'en', BASE_CURRENCY: 'USD', diff --git a/projects/storefrontapp-e2e-cypress/cypress.config.ts b/projects/storefrontapp-e2e-cypress/cypress.config.ts index 7a3640396fe..e57bfab4355 100644 --- a/projects/storefrontapp-e2e-cypress/cypress.config.ts +++ b/projects/storefrontapp-e2e-cypress/cypress.config.ts @@ -17,7 +17,8 @@ export default defineConfig({ env: { CLIENT_ID: 'mobile_android', CLIENT_SECRET: 'secret', - API_URL: 'https://40.76.109.9:9002', + API_URL: + 'https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud', BASE_SITE: 'electronics-spa', BASE_LANG: 'en', BASE_CURRENCY: 'USD', diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/order-history/b2b-order-history-orders-flow.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/order-history/b2b-order-history-orders-flow.e2e.cy.ts index 9ffb08f4afd..733aa51a3ad 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/order-history/b2b-order-history-orders-flow.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/order-history/b2b-order-history-orders-flow.e2e.cy.ts @@ -57,8 +57,8 @@ describe('Order History with orders', { testIsolation: false }, () => { b2bCheckout.selectAccountPayment(); }); - it('should enter shipping address', () => { - b2bCheckout.selectAccountShippingAddress(); + it('should have shipping address', () => { + b2bCheckout.confirmAccountShippingAddress(); }); it('should select delivery mode', () => { diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-daily-replenishment-checkout-flow.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-daily-replenishment-checkout-flow.e2e.cy.ts index e6b57e097ae..bdc3cf0b1a6 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-daily-replenishment-checkout-flow.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-daily-replenishment-checkout-flow.e2e.cy.ts @@ -47,8 +47,8 @@ context( b2bCheckout.selectAccountPayment(); }); - it('should enter shipping address', () => { - b2bCheckout.selectAccountShippingAddress(); + it('should have shipping address', () => { + b2bCheckout.confirmAccountShippingAddress(); }); it('should select delivery mode', () => { diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-monthly-replenishment-checkout-flow.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-monthly-replenishment-checkout-flow.e2e.cy.ts index 1d104e22c3d..88af20e2a4d 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-monthly-replenishment-checkout-flow.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-monthly-replenishment-checkout-flow.e2e.cy.ts @@ -47,8 +47,8 @@ context( b2bCheckout.selectAccountPayment(); }); - it('should enter shipping address', () => { - b2bCheckout.selectAccountShippingAddress(); + it('should have shipping address', () => { + b2bCheckout.confirmAccountShippingAddress(); }); it('should select delivery mode', () => { diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-weekly-replenishment-checkout-flow.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-weekly-replenishment-checkout-flow.e2e.cy.ts index c034cd28ad4..3e9101c7d2f 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-weekly-replenishment-checkout-flow.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/b2b/regression/replenishment/b2b-weekly-replenishment-checkout-flow.e2e.cy.ts @@ -47,8 +47,8 @@ context( b2bCheckout.selectAccountPayment(); }); - it('should enter shipping address', () => { - b2bCheckout.selectAccountShippingAddress(); + it('should have shipping address', () => { + b2bCheckout.confirmAccountShippingAddress(); }); it('should select delivery mode', () => { diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/consignment-tracking/consignment-tracking.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/consignment-tracking/consignment-tracking.e2e.cy.ts index b75ae7ccb18..1a7e4d8f062 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/consignment-tracking/consignment-tracking.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/consignment-tracking/consignment-tracking.e2e.cy.ts @@ -20,20 +20,20 @@ describe('consignment tracking', () => { cy.get('.cx-list') .first() .within(() => { - cy.get('.cx-code').should('contain', '300938'); + cy.get('.cx-code').should('contain', '1992693'); cy.get('.btn-track').click(); }); - cy.get('.cx-tracking-event-body').should('have.length', 3); + cy.get('.cx-no-tracking-heading').should('have.length', 1); cy.get('cx-tracking-events .close').click(); cy.get('.cx-list') .next() .first() .within(() => { - cy.get('.cx-code').should('contain', '1992693'); + cy.get('.cx-code').should('contain', '300938'); cy.get('.btn-track').click(); }); - cy.get('.cx-no-tracking-heading').should('have.length', 1); + cy.get('.cx-tracking-event-body').should('have.length', 3); cy.get('cx-tracking-events .close').click(); cy.get('.cx-list') .last() diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-checkout.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-checkout.ts index e2c0efa99f0..07bf9455610 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-checkout.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-checkout.ts @@ -15,6 +15,7 @@ import { b2bUser, cartWithB2bProductAndPremiumShipping, costCenter, + costCenterId, order_type, poNumber, POWERTOOLS_BASESITE, @@ -199,6 +200,9 @@ export function selectAccountPayment() { cy.wait('@getCart').its('response.statusCode').should('eq', 200); + cy.wait(1000); + cy.get('div > label > select').select(costCenterId); + // intercept costCenter list to get Rustic address Id which will be use in delivery addr/mode stubs cy.wait(`@${getCostCenters}`).then((xhr) => { if ( @@ -208,7 +212,11 @@ export function selectAccountPayment() { // first element of Cost Center is the default one, always match the combo-box selection b2bDeliveryAddress.id = xhr.response.body.costCenters[0].unit.addresses[0].id; + cy.log('Cost center update required'); + } else { + cy.log('Cost center update not required'); } + // cy.pause(); }); } @@ -227,6 +235,23 @@ export function selectCreditCardPayment() { .should('eq', 200); } +export function confirmAccountShippingAddress() { + cy.get('.cx-checkout-title').should('contain', 'Shipping Address'); + cy.get('cx-order-summary .cx-summary-partials .cx-summary-row') + .first() + .find('.cx-summary-amount') + .should('not.be.empty'); + + cy.get('cx-card .card-header').should('contain', 'Selected'); + + verifyTabbingOrder( + 'cx-page-layout.MultiStepCheckoutSummaryPageTemplate', + config.shippingAddressAccount + ); + + cy.get('button.btn-primary').should('be.enabled').click(); +} + export function selectAccountShippingAddress() { const getCheckoutDetails = interceptCheckoutB2BDetailsEndpoint( b2bDeliveryAddressStub, @@ -248,8 +273,10 @@ export function selectAccountShippingAddress() { cy.get('.cx-card-label-bold').should('not.be.empty'); }); - cy.get('cx-card .card-header').should('contain', 'Selected'); + cy.wait(2000); + cy.get('.card-body').click({ force: true }); + cy.get('cx-card .card-header').should('contain', 'Selected'); /** * Delivery mode PUT intercept is not in selectAccountDeliveryMode() * because it doesn't choose a delivery mode and the intercept might have missed timing depending on cypress's performance @@ -260,7 +287,6 @@ export function selectAccountShippingAddress() { 'getDeliveryPage' ); - // Accessibility verifyTabbingOrder( 'cx-page-layout.MultiStepCheckoutSummaryPageTemplate', config.shippingAddressAccount diff --git a/projects/storefrontapp-e2e-cypress/cypress/sample-data/b2b-checkout.ts b/projects/storefrontapp-e2e-cypress/cypress/sample-data/b2b-checkout.ts index 24c0865dce7..dc43bf09ea2 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/sample-data/b2b-checkout.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/sample-data/b2b-checkout.ts @@ -18,6 +18,7 @@ export const USER_REQUEST_ENDPOINT = 'orgUsers'; export const ORDER_REQUEST_ENDPOINT = 'replenishmentOrders'; export const poNumber = '123'; export const costCenter = 'Rustic Global'; +export const costCenterId = 'Rustic_Global'; export const b2bUnit = 'Rustic'; export const replenishmentDay = '8'; export const replenishmentDate = '2100-01-01';