diff --git a/.env-cmdrc b/.env-cmdrc index 0b839dc207c..7c75b977959 100644 --- a/.env-cmdrc +++ b/.env-cmdrc @@ -1,18 +1,18 @@ { "dev": { - "CX_BASE_URL": "https://40.76.109.9:9002" + "CX_BASE_URL": "https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud" }, "s1": { "CX_BASE_URL": "https://api.c432wmya2v-teamspart3-s1-public.model-t.myhybris.cloud" }, "local": { - "CX_BASE_URL": "https://localhost:9002" + "CX_BASE_URL": "https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud" }, "local-http": { - "CX_BASE_URL": "http://localhost:9002" + "CX_BASE_URL": "https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud" }, "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-a11y-helpers.sh b/ci-scripts/e2e-a11y-helpers.sh index 6f3b5deb730..3126302d724 100755 --- a/ci-scripts/e2e-a11y-helpers.sh +++ b/ci-scripts/e2e-a11y-helpers.sh @@ -47,7 +47,11 @@ stop_pwa_app() { build_and_start_pwa() { export SPA_ENV="$1" npm run build:csr - npm run start:pwa & + if [[ "$SPA_ENV" == *"b2b"* ]]; then + npm run start:pwa:b2b & + else + npm run start:pwa & + fi sleep 10 } diff --git a/ci-scripts/e2e-cypress.sh b/ci-scripts/e2e-cypress.sh index f2de2ede432..c46bcd82820 100755 --- a/ci-scripts/e2e-cypress.sh +++ b/ci-scripts/e2e-cypress.sh @@ -164,41 +164,39 @@ if [[ "${SSR}" = true ]]; then npm run e2e:run:ci:ssr fi else - npm run start:pwa & - - echo '-----' - echo "Running Cypress end to end tests" - - if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then - echo "Running Cypress end-to-end tests for pull request" - - if [[ "${GITHUB_HEAD_REF}" == epic/* ]]; then - echo "Running full Cypress end-to-end tests for epic branch" - run_tests_for_suite "${SUITE}" "full" - else - echo "Running core Cypress end-to-end tests for pull requests" - run_tests_for_suite "${SUITE}" "core" - fi - - elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then - echo "Running Cypress end-to-end tests for push event" - - if is_bot_commit; then - echo "Commit was made by Renovate Bot or Dependabot. Running core Cypress end-to-end tests" - run_tests_for_suite "${SUITE}" "core" - else - echo "Running full Cypress end-to-end tests" - run_tests_for_suite "${SUITE}" "full" - fi + if [[ "$SUITE" == *"b2b"* ]]; then + npm run start:pwa:b2b & else - echo "Running full Cypress end-to-end tests" - run_tests_for_suite "${SUITE}" "full" + npm run start:pwa & fi - #Force run vendor tests. - # echo "Force Running Cypress Vendor Product Configurator end-to-end tests" - # run_tests_for_suite ":vendor:product-configurator" "full" - - # echo "Force Running Cypress Vendor CPQ end-to-end tests" - # run_tests_for_suite ":vendor:cpq" "full" + echo '-----' + echo "Running All Cypress end to end tests" + run_tests_for_suite "${SUITE}" "full" + +# if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then +# echo "Running Cypress end-to-end tests for pull request" +# +# if [[ "${GITHUB_HEAD_REF}" == epic/* ]]; then +# echo "Running full Cypress end-to-end tests for epic branch" +# run_tests_for_suite "${SUITE}" "full" +# else +# echo "Running core Cypress end-to-end tests for pull requests" +# run_tests_for_suite "${SUITE}" "core" +# fi +# +# elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then +# echo "Running Cypress end-to-end tests for push event" +# +# if is_bot_commit; then +# echo "Commit was made by Renovate Bot or Dependabot. Running core Cypress end-to-end tests" +# run_tests_for_suite "${SUITE}" "core" +# else +# echo "Running full Cypress end-to-end tests" +# run_tests_for_suite "${SUITE}" "full" +# fi +# else +# echo "Running full Cypress end-to-end tests" +# run_tests_for_suite "${SUITE}" "full" +# fi fi diff --git a/package-lock.json b/package-lock.json index 2913604d4aa..4dc7d6c6edc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -856,6 +856,7 @@ "@spartacus/checkout": "221121.2.0", "@spartacus/core": "221121.2.0", "@spartacus/order": "221121.2.0", + "@spartacus/pickup-in-store": "221121.2.0", "@spartacus/schematics": "221121.2.0", "@spartacus/storefront": "221121.2.0", "@spartacus/styles": "221121.2.0", diff --git a/package.json b/package.json index 4677fb4eac0..9dd65798095 100644 --- a/package.json +++ b/package.json @@ -136,9 +136,9 @@ "prettier": "prettier --config ./.prettierrc --list-different \"{projects,feature-libs,core-libs,integration-libs}/**/*{.ts,.js,.json,.scss,.html}\"", "prettier:fix": "prettier --config ./.prettierrc --list-different \"{projects,feature-libs,core-libs,integration-libs}/**/*{.ts,.js,.json,.scss,.html}\" --write", "start": "env-cmd --no-override -e dev,b2c,$SPA_ENV nx serve storefrontapp --configuration=development", - "start:b2b": "env-cmd --no-override -e dev,b2b,$SPA_ENV nx serve storefrontapp --configuration=development", + "start:b2b": "env-cmd --no-override -e dev,b2b,$SPA_ENV nx serve storefrontapp --configuration=development --port=5200", "start:ci": "env-cmd --no-override -e ci,b2c,$SPA_ENV nx serve storefrontapp --configuration=development", - "start:ci:b2b": "env-cmd --no-override -e ci,b2b,$SPA_ENV nx serve storefrontapp --configuration=development", + "start:ci:b2b": "env-cmd --no-override -e ci,b2b,$SPA_ENV nx serve storefrontapp --configuration=development --port=5200", "start:opf": "env-cmd --no-override -e opf,$SPA_ENV nx serve storefrontapp --configuration=development", "start:opf:ssl": "env-cmd --no-override -e opf,$SPA_ENV nx serve storefrontapp --configuration=development --ssl", "start:opf:b2b": "env-cmd --no-override -e b2b,opf,$SPA_ENV nx serve storefrontapp --configuration=development", @@ -146,6 +146,7 @@ "start:punchout": "env-cmd --no-override -e punchout,$SPA_ENV nx serve storefrontapp --configuration=development", "start:prod": "env-cmd --no-override -e dev,b2c,$SPA_ENV nx serve storefrontapp --configuration=production", "start:pwa": " cd ./dist/storefrontapp/browser && http-server -p 4200 --silent --proxy http://localhost:4200?", + "start:pwa:b2b": " cd ./dist/storefrontapp/browser && http-server -p 5200 --silent --proxy http://localhost:5200?", "test": "nx test", "test:all-schematics": "set -e; npm --prefix ./projects/schematics test -- -u; for dir in feature-libs/* integration-libs/*; do (cd $dir && npm run test:schematics -- -u); done", "test:libs": "concurrently \"nx test core --code-coverage\" \"nx test storefrontlib --code-coverage\" \"nx test cart --code-coverage\" \"nx test organization --code-coverage\" \"nx test storefinder --code-coverage\" \"nx test smartedit --code-coverage\" \"nx test asm --code-coverage\" \"nx test qualtrics --code-coverage\" \"nx test product --code-coverage\" \"nx test product-configurator --code-coverage\" \"nx test product-multi-dimensional --code-coverage\" \"nx test customer-ticketing --code-coverage\" \"nx test subscription-billing --code-coverage\" \"nx test cdc --code-coverage\" \"nx test s4-service --code-coverage\" \"nx test cdp --code-coverage\" \"nx test opps --code-coverage\" \"nx test setup --code-coverage\" \"nx test checkout --code-coverage\" \"nx test order --code-coverage\" \"nx test digital-payments --code-coverage\" \"nx test epd-visualization --code-coverage\" \"nx test pickup-in-store --code-coverage\" \"nx test s4om --code-coverage\" \"nx test cpq-quote --code-coverage\" \"nx test omf --code-coverage\" \"nx test requested-delivery-date --code-coverage\" \"nx test estimated-delivery-date --code-coverage\" \"nx test pdf-invoices --code-coverage\" \"nx test quote --code-coverage\" \"nx test opf --code-coverage\" \"nx test punchout --code-coverage\"", diff --git a/projects/core/src/features-config/feature-toggles/config/feature-toggles.ts b/projects/core/src/features-config/feature-toggles/config/feature-toggles.ts index 2e200668478..1b85c76670a 100644 --- a/projects/core/src/features-config/feature-toggles/config/feature-toggles.ts +++ b/projects/core/src/features-config/feature-toggles/config/feature-toggles.ts @@ -685,7 +685,7 @@ export const defaultFeatureToggles: Required = { unifiedDefaultHeaderSlotsAcrossBreakpoints: false, reserveSpaceForImagesOnPdpAndPlp: false, lazyLoadImagesByDefault: false, - authorizationCodeFlowByDefault: false, + authorizationCodeFlowByDefault: true, incrementProcessesCountForMergeCart: true, dispatchLoginActionOnlyWhenTokenReceived: false, defaultLayoutConfigWithoutPageFold: false, diff --git a/projects/storefrontapp-e2e-cypress/cypress-jdk21-asm.config.ci.ts b/projects/storefrontapp-e2e-cypress/cypress-asm.config.ci.ts similarity index 87% rename from projects/storefrontapp-e2e-cypress/cypress-jdk21-asm.config.ci.ts rename to projects/storefrontapp-e2e-cypress/cypress-asm.config.ci.ts index 330d8cc80b6..c0021a4e521 100644 --- a/projects/storefrontapp-e2e-cypress/cypress-jdk21-asm.config.ci.ts +++ b/projects/storefrontapp-e2e-cypress/cypress-asm.config.ci.ts @@ -14,7 +14,7 @@ export default defineConfig({ ...baseConfig.env, CLIENT_ID: 'asm_client', API_URL: - 'https://api.c432wmya2v-teamspart3-s4-public.model-t.myhybris.cloud', + 'https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud', JDK_VERSION: 'JDK21', }, }); diff --git a/projects/storefrontapp-e2e-cypress/cypress-jdk21.config.ci.ts b/projects/storefrontapp-e2e-cypress/cypress-b2b.config.ci.ts similarity index 56% rename from projects/storefrontapp-e2e-cypress/cypress-jdk21.config.ci.ts rename to projects/storefrontapp-e2e-cypress/cypress-b2b.config.ci.ts index 00a71491f26..2251c1a02c2 100644 --- a/projects/storefrontapp-e2e-cypress/cypress-jdk21.config.ci.ts +++ b/projects/storefrontapp-e2e-cypress/cypress-b2b.config.ci.ts @@ -1,5 +1,4 @@ /* - * SPDX-FileCopyrightText: 2022 SAP Spartacus team * SPDX-FileCopyrightText: 2025 SAP Spartacus team * * SPDX-License-Identifier: Apache-2.0 @@ -12,9 +11,13 @@ export default defineConfig({ ...baseConfig, env: { ...baseConfig.env, - CLIENT_ID: 'mobile_android_public', - API_URL: - 'https://api.c432wmya2v-teamspart3-s4-public.model-t.myhybris.cloud', - JDK_VERSION: 'JDK21', + CLIENT_ID: + baseConfig?.env?.JDK_VERSION === 'JDK21' + ? 'mobile_android_public_b2b' + : 'mobile_android', + }, + e2e: { + ...baseConfig.e2e, + baseUrl: 'http://localhost:5200', }, }); diff --git a/projects/storefrontapp-e2e-cypress/cypress-jdk21.config.ts b/projects/storefrontapp-e2e-cypress/cypress-b2b.config.ts similarity index 59% rename from projects/storefrontapp-e2e-cypress/cypress-jdk21.config.ts rename to projects/storefrontapp-e2e-cypress/cypress-b2b.config.ts index da8b2b2302a..bbcae9c70d4 100644 --- a/projects/storefrontapp-e2e-cypress/cypress-jdk21.config.ts +++ b/projects/storefrontapp-e2e-cypress/cypress-b2b.config.ts @@ -11,9 +11,13 @@ export default defineConfig({ ...baseConfig, env: { ...baseConfig.env, - CLIENT_ID: 'mobile_android_public', - API_URL: - 'https://api.c432wmya2v-teamspart3-s4-public.model-t.myhybris.cloud', - JDK_VERSION: 'JDK21', + CLIENT_ID: + baseConfig?.env?.JDK_VERSION === 'JDK21' + ? 'mobile_android_public_b2b' + : 'mobile_android', + }, + e2e: { + ...baseConfig.e2e, + baseUrl: 'http://localhost:5200', }, }); diff --git a/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts b/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts index 5bd85851168..810d7878de0 100644 --- a/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts +++ b/projects/storefrontapp-e2e-cypress/cypress.config.ci.ts @@ -6,6 +6,15 @@ import { defineConfig } from 'cypress'; +const JDK_VERSION: string = 'JDK21'; +const CLIENT_ID = + JDK_VERSION === 'JDK21' ? 'mobile_android_public' : 'mobile_android'; + +const API_URL = + JDK_VERSION === 'JDK21' + ? 'https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud' + : 'https://api.c432wmya2v-teamspart3-s3-public.model-t.myhybris.cloud'; + export default defineConfig({ defaultCommandTimeout: 30000, requestTimeout: 30000, @@ -18,18 +27,18 @@ export default defineConfig({ }, videoUploadOnPasses: false, env: { - API_URL: 'https://20.83.184.244:9002', + API_URL, BASE_SITE: 'electronics-spa', BASE_LANG: 'en', BASE_CURRENCY: 'USD', - CLIENT_ID: 'mobile_android', + CLIENT_ID, CLIENT_SECRET: 'secret', OCC_PREFIX: '/occ/v2', OCC_PREFIX_USER_ENDPOINT: 'users', OCC_PREFIX_ORDER_ENDPOINT: 'orders', MAIL_CCV2_URL: 'https://mailhog-poc.westeurope.cloudapp.azure.com', MAIL_CCV2_PREFIX: '/api/v1', - JDK_VERSION: 'JDK17', + JDK_VERSION, }, e2e: { // We've imported your old cypress plugins here. diff --git a/projects/storefrontapp-e2e-cypress/cypress.config.ts b/projects/storefrontapp-e2e-cypress/cypress.config.ts index 74924bb7186..d96e95040b0 100644 --- a/projects/storefrontapp-e2e-cypress/cypress.config.ts +++ b/projects/storefrontapp-e2e-cypress/cypress.config.ts @@ -6,28 +6,39 @@ import { defineConfig } from 'cypress'; +const JDK_VERSION: string = 'JDK21'; +const CLIENT_ID = + JDK_VERSION === 'JDK21' ? 'mobile_android_public' : 'mobile_android'; + +const API_URL = + JDK_VERSION === 'JDK21' + ? 'https://api.c432wmya2v-teamspart3-s2-public.model-t.myhybris.cloud' + : 'https://api.c432wmya2v-teamspart3-s3-public.model-t.myhybris.cloud'; + export default defineConfig({ - defaultCommandTimeout: 10000, - requestTimeout: 15000, + defaultCommandTimeout: 30000, + requestTimeout: 30000, + projectId: 'k3nmep', + numTestsKeptInMemory: 100, chromeWebSecurity: false, + video: true, retries: { runMode: 2, - openMode: 2, }, videoUploadOnPasses: false, env: { - CLIENT_ID: 'mobile_android', - CLIENT_SECRET: 'secret', - API_URL: 'https://40.76.109.9:9002', + API_URL, BASE_SITE: 'electronics-spa', BASE_LANG: 'en', BASE_CURRENCY: 'USD', + CLIENT_ID, + CLIENT_SECRET: 'secret', OCC_PREFIX: '/occ/v2', OCC_PREFIX_USER_ENDPOINT: 'users', OCC_PREFIX_ORDER_ENDPOINT: 'orders', MAIL_CCV2_URL: 'https://mailhog-poc.westeurope.cloudapp.azure.com', MAIL_CCV2_PREFIX: '/api/v1', - JDK_VERSION: 'JDK17', + JDK_VERSION, }, e2e: { // We've imported your old cypress plugins here. diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/a11y/b2c/scroll-to-top-button.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/a11y/b2c/scroll-to-top-button.e2e.cy.ts index cbb9160b47f..999777047ce 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/a11y/b2c/scroll-to-top-button.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/a11y/b2c/scroll-to-top-button.e2e.cy.ts @@ -7,11 +7,11 @@ describe('Scroll to top button', () => { beforeEach(() => { cy.visit('/'); - cy.scrollTo('bottom'); - cy.get('.cx-scroll-to-top-btn').as('scrollBtn'); - // close the cookie banner cy.get('button').contains('Allow All').click(); + + cy.scrollTo('bottom'); + cy.get('.cx-scroll-to-top-btn').as('scrollBtn'); }); it('should appear when the page is scrolled down', () => { diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/anonymous-consents/anonymous-consents-config-flow.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/anonymous-consents/anonymous-consents-config-flow.e2e.cy.ts index dd96b8751e8..c82ebded665 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/anonymous-consents/anonymous-consents-config-flow.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/anonymous-consents/anonymous-consents-config-flow.e2e.cy.ts @@ -70,9 +70,16 @@ context('Anonymous consents - config flow', () => { hideConsents: [STORE_USER_INFORMATION], } ); + cy.intercept('GET', '**/users/anonymous/consenttemplates*').as( + 'getConsentTemplates' + ); + const homePage = waitForPage('homepage', 'getHomePage'); cy.visit('/'); cy.wait(`@${homePage}`).its('response.statusCode').should('eq', 200); + cy.wait('@getConsentTemplates') + .its('response.statusCode') + .should('eq', 200); }); anonymousConfigTestFlow(); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/cart/cart-import-export.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/cart/cart-import-export.e2e.cy.ts index 2eb7f787943..0cd88e87360 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/cart/cart-import-export.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/cart/cart-import-export.e2e.cy.ts @@ -14,6 +14,11 @@ context('Cart Import/Export', () => { viewportContext(['mobile'], () => { beforeEach(() => { clearAllStorage(); + cy.intercept('HEAD', '**/users/anonymous/consenttemplates?*', { + statusCode: 304, + }).as('headConsent'); + cy.intercept('POST', '**/users/*/carts/*/entries?**').as('addToCart'); + cy.intercept('GET', '**/users/*/carts/*?fields=**').as('refreshCart'); }); // Core test. diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.desktop.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.desktop.e2e.cy.ts new file mode 100644 index 00000000000..ac670b19fe5 --- /dev/null +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.desktop.e2e.cy.ts @@ -0,0 +1,109 @@ +/* + * SPDX-FileCopyrightText: 2025 SAP Spartacus team + * SPDX-FileCopyrightText: 2025 SAP Spartacus team + * + * SPDX-License-Identifier: Apache-2.0 + */ + +import { CheckoutConfig } from '@spartacus/storefront'; +import { login } from '../../../helpers/auth-forms'; +import * as guestCheckout from '../../../helpers/checkout-as-guest'; +import * as checkout from '../../../helpers/checkout-flow'; +import * as loginHelper from '../../../helpers/login'; +import { waitForPage } from '../../../helpers/navigation'; +import { cheapProduct } from '../../../sample-data/checkout-flow'; +import { isolateTests } from '../../../support/utils/test-isolation'; + +const alias = (name: string) => `desktop__${name}`; + +context('Checkout as guest (desktop)', { testIsolation: true }, () => { + isolateTests(); + + before(() => { + cy.window().then((win) => win.sessionStorage.clear()); + guestCheckout.generateGuestUser(); + }); + + beforeEach(() => { + cy.viewport('macbook-16'); + cy.cxConfig({ checkout: { guest: true } } as CheckoutConfig); + + cy.intercept('GET', '**/cms/pages?lang=*&curr=*').as('getHomePage'); + + cy.intercept('GET', '**/users/current/carts**').as('getCartsAfterLogin'); + }); + + guestCheckout.testCheckoutAsGuest(); + + it('should keep products in guest cart and restart checkout', () => { + cy.whenJDK21(() => { + cy.log('skip for JDK21, will be fix by CXSPA-10758'); + }); + + cy.whenJDK17(() => { + checkout.goToCheapProductDetailsPage(); + checkout.addCheapProductToCartAndProceedToCheckout(); + + guestCheckout.loginAsGuest(guestCheckout.guestUser); + checkout.fillAddressFormWithCheapProduct(); + + const deliveryAddressPage = waitForPage( + '/checkout/delivery-address', + alias('getDeliveryPage') + ); + + checkout.clickHamburger(); + cy.getLoginRegisterLink({ clickAndWait: true }); + + cy.intercept('POST', '**/authorizationserver/oauth/token').as( + alias('oauth') + ); + cy.intercept('GET', '**/users/current/carts**').as( + alias('getCartsAfterLogin') + ); + + login(guestCheckout.guestUser.email, guestCheckout.guestUser.password); + + cy.wait(`@${alias('oauth')}`, { timeout: 30000 }).then((xhr) => { + const status = xhr?.response?.statusCode; + if (![200, 201].includes(status as number)) { + cy.log(`OAuth ${status} – retry login once`); + login( + guestCheckout.guestUser.email, + guestCheckout.guestUser.password + ); + cy.wait(`@${alias('oauth')}`, { timeout: 30000 }) + .its('response.statusCode') + .should('be.oneOf', [200, 201]); + } + }); + + cy.wait(`@${deliveryAddressPage}`, { timeout: 30000 }) + .its('response.statusCode') + .should('eq', 200); + + cy.get('cx-login div.cx-login-greet', { timeout: 20000 }).should('exist'); + cy.get('.cx-checkout-title').should('contain', 'Shipping Address'); + + cy.wait(`@${alias('getCartsAfterLogin')}`, { timeout: 30000 }) + .its('response.statusCode') + .should('be.oneOf', [200, 204]); + + cy.get('cx-mini-cart .count', { timeout: 20000 }).should('contain', '1'); + + const cartPage = waitForPage('/cart', alias('getCartPage')); + cy.get('cx-mini-cart').click(); + cy.wait(`@${cartPage}`, { timeout: 30000 }) + .its('response.statusCode') + .should('eq', 200); + + cy.get('cx-cart-item-list') + .contains('tr[cx-cart-item-list-row]', cheapProduct.code) + .within(() => { + cy.get('cx-item-counter input').should('have.value', '1'); + }); + + loginHelper.signOutUser(); + }); + }); +}); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.e2e.cy.ts deleted file mode 100644 index 5fa421d83f1..00000000000 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.e2e.cy.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 SAP Spartacus team - * - * SPDX-License-Identifier: Apache-2.0 - */ - -import { CheckoutConfig } from '@spartacus/storefront'; -import { login } from '../../../helpers/auth-forms'; -import * as guestCheckout from '../../../helpers/checkout-as-guest'; -import * as checkout from '../../../helpers/checkout-flow'; -import * as loginHelper from '../../../helpers/login'; -import { waitForPage } from '../../../helpers/navigation'; -import { viewportContext } from '../../../helpers/viewport-context'; -import { cheapProduct } from '../../../sample-data/checkout-flow'; -import { isolateTests } from '../../../support/utils/test-isolation'; -context('Checkout as guest', { testIsolation: false }, () => { - viewportContext(['mobile', 'desktop'], () => { - isolateTests(); - before(() => { - cy.window().then((win) => win.sessionStorage.clear()); - guestCheckout.generateGuestUser(); - }); - - beforeEach(() => { - cy.cxConfig({ checkout: { guest: true } } as CheckoutConfig); - }); - - // Core e2e test. - guestCheckout.testCheckoutAsGuest(); - - // Test depends on on core test for guest account creation. - // JDK21: identified bug CXSPA-10758, skip test until fix gets applied - it('should keep products in guest cart and restart checkout', () => { - cy.whenJDK21(() => { - cy.log('skip for JDK21, will be fix by CXSPA-10758'); - }); - cy.whenJDK17(() => { - checkout.goToCheapProductDetailsPage(); - checkout.addCheapProductToCartAndProceedToCheckout(); - - guestCheckout.loginAsGuest(guestCheckout.guestUser); - - checkout.fillAddressFormWithCheapProduct(); - - const deliveryAddressPage = waitForPage( - '/checkout/delivery-address', - 'getDeliveryPage' - ); - - checkout.clickHamburger(); - - cy.getLoginRegisterLink({ clickAndWait: true }); - - login(guestCheckout.guestUser.email, guestCheckout.guestUser.password); - cy.wait(`@${deliveryAddressPage}`) - .its('response.statusCode') - .should('eq', 200); - - cy.get('cx-login div.cx-login-greet').should('exist'); - cy.get('.cx-checkout-title').should('contain', 'Shipping Address'); - - cy.get('cx-mini-cart .count').contains('1'); - - const cartPage = waitForPage('/cart', 'getCartPage'); - cy.get('cx-mini-cart').click(); - cy.wait(`@${cartPage}`).its('response.statusCode').should('eq', 200); - - cy.get('cx-cart-item-list') - .contains('tr[cx-cart-item-list-row]', cheapProduct.code) - .within(() => { - cy.get('cx-item-counter input').should('have.value', '1'); - }); - loginHelper.signOutUser(); - }); - }); - }); -}); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.mobile.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.mobile.e2e.cy.ts new file mode 100644 index 00000000000..db25aa2f8aa --- /dev/null +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/checkout/checkout-as-guest.mobile.e2e.cy.ts @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2025 SAP Spartacus team + * SPDX-FileCopyrightText: 2025 SAP Spartacus team + * + * SPDX-License-Identifier: Apache-2.0 + */ + +import { CheckoutConfig } from '@spartacus/storefront'; +import * as guestCheckout from '../../../helpers/checkout-as-guest'; +import { isolateTests } from '../../../support/utils/test-isolation'; + +const alias = (name: string) => `mobile__${name}`; + +context('Checkout as guest (mobile)', { testIsolation: true }, () => { + isolateTests(); + + before(() => { + cy.window().then((win) => win.sessionStorage.clear()); + guestCheckout.generateGuestUser(); + }); + + beforeEach(() => { + cy.viewport('iphone-6'); + cy.cxConfig({ checkout: { guest: true } } as CheckoutConfig); + + cy.intercept('GET', '**/cms/pages?lang=*&curr=*').as('getHomePage'); + + cy.intercept('GET', '**/users/current/carts**').as('getCartsAfterLogin'); + }); + + guestCheckout.testCheckoutAsGuest(); +}); 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 ea75a3f034e..d8ff29035b0 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 @@ -9,45 +9,45 @@ import { viewportContext } from '../../../helpers/viewport-context'; describe('consignment tracking', () => { viewportContext(['desktop', 'mobile'], () => { - before(() => { + beforeEach(() => { cy.window().then((win) => win.sessionStorage.clear()); orderDetail.loginUsingUserWithOrder(); }); - it('should see tracking package button and tracking events when consignment is shipped', () => { + it('should display tracking button and details for shipped consignments', () => { cy.visit('/my-account/order/100000'); - cy.get('.cx-list').should('have.length', 3); - cy.get('.cx-list') - .filter( - ':has(span:contains("Shipped")):has(.cx-code:contains("300938"))' - ) - .first() - .within(() => { - cy.get('.cx-code').should('contain', '300938'); - cy.get('.btn-track').click(); - }); - cy.get('.cx-tracking-event-body').should('have.length', 3); + .filter(':has(.cx-list-status span:contains("Shipped"))') + .each(($consignment) => { + cy.wrap($consignment).within(() => { + cy.get('.cx-code').should('not.be.empty'); + cy.get('.btn-track') + .should('exist') + .should('be.visible') + .scrollIntoView() + .click(); + }); - cy.get('cx-tracking-events .close').click(); + cy.get('cx-tracking-events').should('be.visible'); - cy.get('.cx-list') - .filter( - ':has(span:contains("Shipped")):has(.cx-code:contains("1992693"))' - ) - .first() - .within(() => { - cy.get('.cx-code').should('contain', '1992693'); - cy.get('.btn-track').click(); + cy.get('cx-tracking-events').within(() => { + cy.get('.cx-tracking-event-body, .cx-no-tracking-heading').should( + 'exist' + ); + cy.get('.close').click(); + }); }); - cy.get('.cx-no-tracking-heading').should('have.length', 1); - cy.get('cx-tracking-events .close').click(); + }); + + it('should not see tracking button for waiting consignment', () => { + cy.visit('/my-account/order/100000'); cy.get('.cx-list') - .filter(':has(span:contains("Waiting"))') - .first() - .within(() => { - cy.get('.cx-code').should('contain', '1377492'); - cy.get('.btn-track').should('have.length', 0); + .filter(':has(.cx-list-status span:contains("Waiting"))') + .each(($consignment) => { + cy.wrap($consignment).within(() => { + cy.get('.cx-code').should('not.be.empty'); + cy.get('.btn-track').should('not.exist'); + }); }); }); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow-desktop.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow-desktop.e2e.cy.ts new file mode 100644 index 00000000000..1f367a3b5f9 --- /dev/null +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow-desktop.e2e.cy.ts @@ -0,0 +1,109 @@ +/* + * SPDX-FileCopyrightText: 2025 SAP Spartacus team + * + * SPDX-License-Identifier: Apache-2.0 + */ + +import { + clickOnPrimaryDialogButton, + verifyProductIsDisplayed, +} from '../../../helpers/b2b/b2b-saved-cart'; +import { + clickOnActionLink, + doPlaceOrder, + interceptAddToCartEndpoint, + interceptCartPageEndpoint, + orderHistoryTest, + verifyActionLinkHasText, + waitForResponse, +} from '../../../helpers/order-history'; +import { viewportContext } from '../../../helpers/viewport-context'; +import { product } from '../../../sample-data/checkout-flow'; +import { waitForOrderWithConsignmentToBePlacedRequest } from '../../../support/utils/order-placed'; +import { isolateTestsBefore } from '../../../support/utils/test-isolation'; + +describe('Order History with orders', () => { + viewportContext(['mobile'], () => { + before(() => { + cy.window().then((win) => win.sessionStorage.clear()); + cy.visit('/'); + cy.requireLoggedIn(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); + + orderHistoryTest.checkIfOrderIsDisplayed(); + orderHistoryTest.checkSortingByCode(); + orderHistoryTest.checkCorrectDateFormat(); + orderHistoryTest.checkTabsAreDisplayedAfterNavigation(); + }); +}); + +describe('Order details page', { testIsolation: false }, () => { + viewportContext(['desktop'], () => { + isolateTestsBefore(); + let formattedValue: any; + + orderHistoryTest.checkOrderDetailsUnconsignedEntries(); + + before(() => { + cy.visit('/'); + cy.requireLoggedIn(); + doPlaceOrder().then((orderData: any) => { + formattedValue = orderData.body.totalPrice.formattedValue; + cy.waitForOrderToBePlacedRequest( + undefined, + undefined, + orderData.body.code + ); + cy.visit('/my-account/orders'); + + cy.get('.cx-order-history-code > .cx-order-history-value', { + timeout: 30000, + }).then((el) => { + const orderNumber = el.text().match(/\d+/)[0]; + waitForOrderWithConsignmentToBePlacedRequest(orderNumber); + }); + + cy.get('.cx-order-history-code > .cx-order-history-value', { + timeout: 10000, + }) + .should('exist') + .first() + .click(); + }); + }); + it('should display order details page with consigned entries', () => { + cy.get('.cx-item-list-row .cx-link').should('contain', product.name); + cy.get('.cx-item-list-row .cx-code').should('contain', product.code); + cy.get('.cx-summary-total > .cx-summary-amount').should( + 'contain', + formattedValue + ); + }); + + it('should add product to cart from order details page', () => { + const addToCartAlias = interceptAddToCartEndpoint(); + + const cartPageAlias = interceptCartPageEndpoint(); + + verifyActionLinkHasText('Buy It Again'); + + clickOnActionLink(); + + waitForResponse(addToCartAlias); + + clickOnPrimaryDialogButton(); + + waitForResponse(cartPageAlias); + + verifyProductIsDisplayed(product.name, product.code); + }); + }); +}); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow.e2e.cy.ts index 2f8f9f0139b..1c56e27141f 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/my-account/order-history-orders-flow.e2e.cy.ts @@ -46,7 +46,7 @@ describe('Order History with orders', () => { }); describe('Order details page', { testIsolation: false }, () => { - viewportContext(['mobile', 'desktop'], () => { + viewportContext(['mobile'], () => { isolateTestsBefore(); let formattedValue: any; @@ -63,14 +63,17 @@ describe('Order details page', { testIsolation: false }, () => { orderData.body.code ); cy.visit('/my-account/orders'); - cy.get('.cx-order-history-code > .cx-order-history-value').then( - (el) => { - const orderNumber = el.text().match(/\d+/)[0]; - waitForOrderWithConsignmentToBePlacedRequest(orderNumber); - } - ); - cy.get('.cx-order-history-code > .cx-order-history-value') + cy.get('.cx-order-history-code > .cx-order-history-value', { + timeout: 30000, + }).then((el) => { + const orderNumber = el.text().match(/\d+/)[0]; + waitForOrderWithConsignmentToBePlacedRequest(orderNumber); + }); + + cy.get('.cx-order-history-code > .cx-order-history-value', { + timeout: 10000, + }) .should('exist') .first() .click(); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-cart-page.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-cart-page.e2e.cy.ts index c00c1c51d3e..e4e9f1d13d3 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-cart-page.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-cart-page.e2e.cy.ts @@ -36,7 +36,10 @@ context('Currency switch - cart page', () => { method: 'GET', path: siteContextSelector.CURRENCY_REQUEST, }).as('currencies_request'); - cy.wait(`@currencies_request`).its('response.statusCode').should('eq', 200); + cy.wait('@currencies_request', { timeout: 60000 }) + .its('response.statusCode') + .should('eq', 200); + cy.get('.SiteContext label', { timeout: 30000 }).contains('Currency'); }); describe('cart page', () => { diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-checkout-page.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-checkout-page.e2e.cy.ts index 9ae2e495039..15d05a641c2 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-checkout-page.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/site-context/currency/currency-checkout-page.e2e.cy.ts @@ -37,7 +37,7 @@ describe('Currency switch - checkout page', () => { )}/users/current/carts/*/addresses/delivery`, }).as('setAddress'); cy.visit(checkoutShippingPath); - cy.wait('@setAddress', { timeout: 10000 }); + cy.wait('@setAddress', { timeout: 30000 }); siteContextSelector.verifySiteContextChangeUrl( null, siteContextSelector.CURRENCIES, diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/variants/apparel-checkout-as-guest.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/variants/apparel-checkout-as-guest.e2e.cy.ts index a3c5072481d..1a5f06aa6c5 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/variants/apparel-checkout-as-guest.e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/regression/variants/apparel-checkout-as-guest.e2e.cy.ts @@ -12,15 +12,12 @@ import { import { viewportContext } from '../../../helpers/viewport-context'; context('Apparel - checkout as guest', () => { - viewportContext(['desktop', 'mobile'], () => { + viewportContext(['mobile'], () => { describe('core tests', () => { - before(() => { - checkoutVariants.generateVariantGuestUser(); - }); - beforeEach(() => { Cypress.env('BASE_SITE', APPAREL_BASESITE); configureProductWithVariants(); + checkoutVariants.generateVariantGuestUser(); }); checkoutVariants.testCheckoutVariantAsGuest(); @@ -29,13 +26,10 @@ context('Apparel - checkout as guest', () => { viewportContext(['desktop'], () => { describe('all tests', () => { - before(() => { - checkoutVariants.generateVariantGuestUser(); - }); - beforeEach(() => { Cypress.env('BASE_SITE', APPAREL_BASESITE); configureProductWithVariants(); + checkoutVariants.generateVariantGuestUser(); }); checkoutVariants.testCheckoutVariantAsGuestAndVerifyCart(); diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/ssr/pages.core-e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/ssr/pages.core-e2e.cy.ts index f76226d0c82..ec0ed1f86f8 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/e2e/ssr/pages.core-e2e.cy.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/ssr/pages.core-e2e.cy.ts @@ -8,25 +8,47 @@ describe('SSR', () => { const plpUrl = '/Brands/Sony/c/brand_5'; const pdpUrl = '/product/3965240/np-fv-70'; + before(() => { + cy.request('/'); + cy.request(plpUrl); + cy.request(pdpUrl); + }); + beforeEach(() => { - cy.intercept({ method: 'GET', url: '*.js' }, { body: '' }); + cy.intercept('GET', '**/cms/pages?*').as('cmsPage'); + + cy.intercept('HEAD', '**/users/anonymous/consenttemplates*', { + statusCode: 304, + }).as('headConsentTemplates'); }); function seoChecks() { cy.title().should('not.be.empty'); - cy.get('head meta[name="robots"]') - .should('have.attr', 'content') - .and('contains', 'INDEX') - .and('contains', 'FOLLOW'); - cy.get('link[rel="canonical"]').should('have.attr', 'href'); - cy.get('script[id="json-ld"]') - .should('not.be.empty') - .and('have.attr', 'type') - .and('eq', 'application/ld+json'); + cy.document() + .its('readyState', { timeout: 60000 }) + .should('eq', 'complete'); + cy.title({ timeout: 60000 }).should('not.be.empty'); + + cy.get('head meta[name="robots"]', { timeout: 60000 }) + .invoke('attr', 'content') + .should('match', /index/i) + .and('match', /follow/i); + + cy.get('link[rel="canonical"]', { timeout: 60000 }).should( + 'have.attr', + 'href' + ); + + cy.get('script[type="application/ld+json"]', { timeout: 60000 }) + .should('have.length.greaterThan', 0) + .each(($s) => { + expect(($s.text() || '').trim()).to.not.equal(''); + }); } it('should render homepage', () => { cy.visit('/'); + cy.wait('@cmsPage'); seoChecks(); diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/anonymous-consents.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/anonymous-consents.ts index b306ee63fca..542cd539505 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/anonymous-consents.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/anonymous-consents.ts @@ -119,10 +119,22 @@ export function clickViewDetailsFromBanner() { } export function openAnonymousConsentsDialog() { - cy.get('cx-anonymous-consent-open-dialog').within(() => { - const link = cy.get('button'); - link.should('exist'); - link.click({ force: true }); + cy.get('body').then(($body) => { + const hasBannerBtn = + $body.find('cx-anonymous-consent-management-banner .btn-secondary') + .length > 0; + + if (hasBannerBtn) { + cy.log('Opening dialog via banner'); + cy.get('cx-anonymous-consent-management-banner .btn-secondary') + .should('be.visible') + .click({ force: true }); + } else { + cy.log('Opening dialog via footer link'); + cy.get('cx-anonymous-consent-open-dialog button', { timeout: 10000 }) + .should('exist') + .click({ force: true }); + } }); } @@ -319,8 +331,21 @@ export function showAnonymousConfigTest() { }); } +export function stabilizeAnonymousConsentNetwork() { + cy.intercept('HEAD', '**/users/anonymous/consenttemplates*').as( + 'headConsentTemplates' + ); + cy.intercept('GET', '**/users/anonymous/consenttemplates*').as( + 'getConsentTemplates' + ); + + cy.wait(0); +} + export function anonymousConfigTestFlow() { it('should check new register consent and personalizing not visible in consent management page', () => { + stabilizeAnonymousConsentNetwork(); + //first, check that marketing consent in the dialog is disabled openAnonymousConsentsDialog(); checkInputConsentState(0, BE_DISABLED); diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-quick-order.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-quick-order.ts index 1f202ed7b82..c8f156e460a 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-quick-order.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-quick-order.ts @@ -213,6 +213,7 @@ export function addProductToCartWithQuickForm( .type(`${quantity}`); } const alias = this.interceptAddToCartEndpoint(); + cy.get('cx-cart-quick-order-form .apply-quick-order-button').click(); cy.wait(`@${alias}`).its('response.statusCode').should('eq', 200); diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-replenishment-order-history.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-replenishment-order-history.ts index bc2b7715e59..e012294d998 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-replenishment-order-history.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/b2b/b2b-replenishment-order-history.ts @@ -90,12 +90,10 @@ export function verifySorting() { cy.get( `${replenishmentOrderHistorySelector} .cx-replenishment-order-history-code > .cx-replenishment-order-history-value` - ).then(($orders) => { - expect( - $orders[0].textContent - .toString() - .localeCompare($orders[1].textContent.toString()) - ).to.equal(-1); + ).should(($orders) => { + const codes = Array.from($orders).map((el) => el.textContent?.trim() ?? ''); + const sorted = [...codes].sort((a, b) => a.localeCompare(b)); + expect(codes, 'codes sorted ascending').to.deep.equal(sorted); }); } diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/cart-import-export.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/cart-import-export.ts index d179ae8e320..eb90da4a13a 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/cart-import-export.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/cart-import-export.ts @@ -233,17 +233,25 @@ export function restoreCart(cart) { * Check that the imported cart displays correctly in saved carts list. */ export function verifyImportedData(config: ImportConfig, cart) { - cy.get(`cx-saved-cart-list td.cx-saved-cart-list-cart-id`) - .contains(cart.code) + cy.get('cx-saved-cart-list td.cx-saved-cart-list-cart-id') + .contains(cart.code, { timeout: 60000 }) .parentsUntil('tr') .parent() .within(() => { - cy.get(`td.cx-saved-cart-list-cart-name`).contains( - config.savedCartConfig?.name + cy.get('td.cx-saved-cart-list-cart-name').contains( + config.savedCartConfig?.name, + { timeout: 60000 } + ); + cy.get('td.cx-saved-cart-list-date-saved').contains(config.saveTime, { + timeout: 60000, + }); + cy.get('td.cx-saved-cart-list-quantity').contains( + String(config.quantity), + { timeout: 60000 } ); - cy.get(`td.cx-saved-cart-list-date-saved`).contains(config.saveTime); - cy.get(`td.cx-saved-cart-list-quantity`).contains(config.quantity); - cy.get(`td.cx-saved-cart-list-total`).contains(config.total); + cy.get('td.cx-saved-cart-list-total').contains(config.total, { + timeout: 60000, + }); }); } @@ -258,11 +266,20 @@ export function addProductToCart(productCode: string = cart.products[1].code) { cy.visit(`/product/${productCode}`); cy.wait(`@${productPage}`).its('response.statusCode').should('eq', 200); cart.clickAddToCart(); - cy.wait(['@refreshCart', '@addToCart']); - cy.get('cx-added-to-cart-dialog button.btn-primary') - .contains('view cart') - .scrollIntoView() - .should('be.visible'); + cy.wait('@addToCart'); + cy.wait('@refreshCart'); + cy.get('body').then(($body) => { + const $btn = $body + .find('cx-added-to-cart-dialog button.btn-primary') + .filter((_, el) => /view cart/i.test((el.textContent || '').trim())) + .first(); + + if ($btn.length) { + cy.wrap($btn).click({ force: true }); + } else { + cy.visit('/cart'); + } + }); } /** @@ -276,14 +293,29 @@ export function exportCart(expectedData?: string) { const cartPage = waitForPage('/cart', 'getCartPage'); cy.visit('/cart'); cy.wait(`@${cartPage}`).its('response.statusCode').should('eq', 200); + + cy.intercept('GET', '**/users/**/carts/**?fields=**').as('refreshCartFinal'); + cy.wait('@refreshCartFinal', { timeout: 30000 }) + .its('response.statusCode') + .should('eq', 200); + + cy.get('cx-cart-item-list tr[cx-cart-item-list-row]', { + timeout: 10000, + }).should('have.length.greaterThan', 0); + cy.get('cx-export-order-entries button') .contains('Export Product to CSV') .click(); + cy.get('cx-global-message').contains( 'CSV file will download automatically to your device' ); + if (expectedData) { - cy.readFile(TEST_DOWNLOAD_FILE).should('contain', expectedData); + cy.readFile(TEST_DOWNLOAD_FILE, { timeout: 15000 }).should( + 'contain', + expectedData + ); } } diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/cart.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/cart.ts index 8ea775e04ee..76f7921a768 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/cart.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/cart.ts @@ -130,7 +130,11 @@ function checkMiniCartCount(expectedCount) { } export function clickAddToCart() { - cy.get('cx-add-to-cart button[type=submit]').first().click({ force: true }); + cy.get('cx-add-to-cart button[type=submit]', { timeout: 15000 }) + .scrollIntoView() + .should('be.visible') + .first() + .click(); } /** diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/variants/apparel-checkout-flow.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/variants/apparel-checkout-flow.ts index 9e1b16754f3..5219e0a26cd 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/variants/apparel-checkout-flow.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/variants/apparel-checkout-flow.ts @@ -39,7 +39,7 @@ export function addVariantOfSameProductToCart() { export function visitProductWithoutVariantPage() { configureProductWithVariants(); cy.visit(`${APPAREL_BASESITE}/en/GBP/product/300611156`); - cy.get('cx-product-intro').within(() => { + cy.get('cx-product-intro', { timeout: 20000 }).within(() => { cy.get('.code').should('contain', products[2].code); }); cy.get('cx-breadcrumb').within(() => { diff --git a/projects/storefrontapp-e2e-cypress/package.json b/projects/storefrontapp-e2e-cypress/package.json index bf6a8d8ad78..f11a7664832 100644 --- a/projects/storefrontapp-e2e-cypress/package.json +++ b/projects/storefrontapp-e2e-cypress/package.json @@ -8,41 +8,41 @@ "preinstall": "node scripts/preinstall.js", "cy:open": "cypress open", "cy:open:ci": "cypress open --config-file cypress.config.ci.ts", - "cy:open:ci:b2b": "cypress open --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", + "cy:open:ci:b2b": "cypress open --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", "cy:open:jdk21": "cypress open --config-file cypress-jdk21.config.ts", "cy:open:jdk21:ci": "cypress open --config-file cypress-jdk21.config.ci.ts", "cy:open::jdk21ci:b2b": "npm run cy:open:jdk21:ci -- --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", - "cy:open:b2b": "cypress open --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", + "cy:open:b2b": "cypress open --config-file cypress-b2b.config.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", "cy:open:epd-visualization": "cypress open --env BASE_SITE=powertools-epdvisualization-spa", "cy:open:ccv2": "cypress open --config baseUrl=https://spartacusstore.cg79x9wuu9-eccommerc1-p1-public.model-t.myhybris.cloud --env API_URL=https://api.cg79x9wuu9-eccommerc1-p1-public.model-t.myhybris.cloud", - "cy:open:opf:b2b": "cypress open --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --env API_URL=https://api.cp96avkh5f-integrati1-d1-public.model-t.cc.commerce.ondemand.com", + "cy:open:opf:b2b": "cypress open --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --env API_URL=https://api.cp96avkh5f-integrati1-d1-public.model-t.cc.commerce.ondemand.com", "cy:run": "cypress run", "cy:run:jdk21": "cypress run --config-file cypress-jdk21.config.ts", "cy:run:jdk21:core": "npm run cy:run:jdk21 -- --spec \"cypress/e2e/**/*.core-e2e.cy.ts\"", - "cy:run:b2b": "cypress run --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", + "cy:run:b2b": "cypress run --config-file cypress-b2b.config.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers", "cy:run:core": "cypress run --spec \"cypress/e2e/**/*.core-e2e.cy.ts\"", "cy:run:a11y": "cypress run --spec \"cypress/e2e/a11y/b2c/**/*.a11y-e2e.cy.ts\"", - "cy:run:a11y:b2b": "cypress run --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts\"", + "cy:run:a11y:b2b": "cypress run --config-file cypress-b2b.config.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts\"", "cy:run:product-configurator-vc": "cypress run --spec \"cypress/e2e/**/*-configurator*.*e2e.cy.ts\"", "cy:run:cpq": "cypress run --config-file cypress.config.ci.ts --config baseUrl=https://jsapps.cpce-teamtiger1-d2-public.model-t.cc.commerce.ondemand.com,defaultCommandTimeout=100000,requestTimeout=1000000,responseTimeout=1000000,pageLoadTimeout=1000000 --reporter junit --reporter-options mochaFile=results/test-results-[hash].xml --env API_URL=https://api.cpce-teamtiger1-d2-public.model-t.cc.commerce.ondemand.com --spec \"cypress/e2e/**/cpq-configuration.core-e2e.cy.ts\"", "cy:run:punchout": "cypress run --config-file cypress.config.ci.ts --env PUNCHOUT=true --spec \"cypress/e2e/b2b/vendor/punchout/*.e2e.cy.ts\"", "cy:run:ci": "cypress run --config-file cypress.config.ci.ts --record --key $CYPRESS_KEY --tag \"b2c,all\" --parallel --ci-build-id $BUILD_NUMBER --group B2C --spec \"cypress/e2e/!(vendor|b2b|ssr|cx_ccv2|cx_mcs)/**/*.e2e.cy.ts,!cypress/e2e/**/*.a11y-e2e.cy.ts,!cypress/e2e/**/my-account-v2*.e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-b2c-[hash].xml", "cy:run:ci:core": "cypress run --config-file cypress.config.ci.ts --record --key $CYPRESS_KEY --tag \"b2c,core\" --parallel --ci-build-id $BUILD_NUMBER --group B2C --spec \"cypress/e2e/!(vendor|b2b|ssr|cx_ccv2|cx_mcs)/**/*.core-e2e.cy.ts\"", "cy:run:ci:a11y": "cypress run --config-file cypress.config.ci.ts --spec \"${CYPRESS_SPEC_OVERRIDE:-cypress/e2e/a11y/b2c/**/*.a11y-e2e.cy.ts}\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-[hash].xml", - "cy:run:ci:a11y:b2b": "cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"${CYPRESS_SPEC_OVERRIDE:-cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts}\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-b2b-[hash].xml", + "cy:run:ci:a11y:b2b": "cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"${CYPRESS_SPEC_OVERRIDE:-cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts}\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-b2b-[hash].xml", "cy:run:ci:a11y:record": "cypress run --config-file cypress.config.ci.ts --record --key $CYPRESS_KEY --tag \"a11y,b2c\" --parallel --ci-build-id $BUILD_NUMBER --group A11Y-B2C --spec \"cypress/e2e/a11y/b2c/**/*.a11y-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-[hash].xml", - "cy:run:ci:a11y:b2b:record": "cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --record --key $CYPRESS_KEY --tag \"a11y,b2b\" --parallel --ci-build-id $BUILD_NUMBER --group A11Y-B2B --spec \"cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-b2b-[hash].xml", - "cy:run:ci:b2b": "cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --record --key $CYPRESS_KEY --tag \"b2b,all\" --parallel --ci-build-id $BUILD_NUMBER --group B2B --spec \"cypress/e2e/b2b/regression/**/*e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-b2b-[hash].xml", - "cy:run:ci:core:b2b": "cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --record --key $CYPRESS_KEY --tag \"b2b,core\" --parallel --ci-build-id $BUILD_NUMBER --group B2B --spec \"cypress/e2e/b2b/regression/**/*.core-e2e.cy.ts\"", + "cy:run:ci:a11y:b2b:record": "cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --record --key $CYPRESS_KEY --tag \"a11y,b2b\" --parallel --ci-build-id $BUILD_NUMBER --group A11Y-B2B --spec \"cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-b2b-[hash].xml", + "cy:run:ci:b2b": "cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --record --key $CYPRESS_KEY --tag \"b2b,all\" --parallel --ci-build-id $BUILD_NUMBER --group B2B --spec \"cypress/e2e/b2b/regression/**/*e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-b2b-[hash].xml", + "cy:run:ci:core:b2b": "cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --record --key $CYPRESS_KEY --tag \"b2b,core\" --parallel --ci-build-id $BUILD_NUMBER --group B2B --spec \"cypress/e2e/b2b/regression/**/*.core-e2e.cy.ts\"", "cy:run:ci:ccv2": "cypress run --config-file cypress.config.ci.ts --config baseUrl=$ENDPOINT_URL_PUBLIC_SPARTACUS --reporter junit --reporter-options mochaFile=results/spartacus-test-results-[hash].xml --env API_URL=$ENDPOINT_URL_PUBLIC_API --spec $E2ES_TO_RUN", "cy:run:ci:ccv2-b2b": "cypress run --config-file cypress.config.ci.ts --config baseUrl=$ENDPOINT_URL_PUBLIC_SPARTACUS --reporter junit --reporter-options mochaFile=results/spartacus-test-results-[hash].xml --env API_URL=$ENDPOINT_URL_PUBLIC_API,BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"cypress/e2e/cx_ccv2/regression/b2b/**/*.e2e.cy.ts\"", "cy:run:ci:ccv2-product-configurator": "cypress run --config-file cypress.config.ci.ts --config baseUrl=$ENDPOINT_URL_PUBLIC_SPARTACUS --reporter junit --reporter-options mochaFile=results/spartacus-test-results-[hash].xml --env API_URL=$ENDPOINT_URL_PUBLIC_API,BASE_SITE=$E2E_BASE_SITE,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec $E2ES_TO_RUN", - "cy:jdk21:run:ci:ccv2-product-configurator": "cypress run --config-file cypress-jdk21-asm.config.ci.ts --config baseUrl=$ENDPOINT_URL_PUBLIC_SPARTACUS --reporter junit --reporter-options mochaFile=results/spartacus-test-results-[hash].xml --env API_URL=$ENDPOINT_URL_PUBLIC_API,BASE_SITE=$E2E_BASE_SITE,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec $E2ES_TO_RUN", + "cy:jdk21:run:ci:ccv2-product-configurator": "cypress run --config-file cypress-asm.config.ci.ts --config baseUrl=$ENDPOINT_URL_PUBLIC_SPARTACUS --reporter junit --reporter-options mochaFile=results/spartacus-test-results-[hash].xml --env API_URL=$ENDPOINT_URL_PUBLIC_API,BASE_SITE=$E2E_BASE_SITE,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec $E2ES_TO_RUN", "cy:run:ci:ssr": "cypress run --config-file cypress.config.ci.ts --config baseUrl=http://localhost:4000 --record --key $CYPRESS_KEY --tag \"ssr,all\" --parallel --ci-build-id $BUILD_NUMBER --group SSR --spec \"cypress/e2e/ssr/*.e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-ssr-[hash].xml", "cy:run:ci:core:ssr": "cypress run --config-file cypress.config.ci.ts --config baseUrl=http://localhost:4000 --record --key $CYPRESS_KEY --tag \"ssr,core\" --parallel --ci-build-id $BUILD_NUMBER --group SSR --spec \"cypress/e2e/ssr/*.core-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-ssr-[hash].xml", "cy:run:ci:cds": "cypress run --config-file cypress.config.ci.ts --tag \"2011,b2c,all-cds\" --group CDS --spec \"cypress/e2e/vendor/cds/**/*.core-e2e.cy.ts\"", "cy:run:ci:cdc": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --tag \"2005,cdc\" --group CDC --spec \"cypress/e2e/vendor/cdc/b2c/*.e2e.cy.ts\"", - "cy:run:ci:cdc-b2b": "cypress run --config-file cypress.ci.json --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers,API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --tag \"2211,cdc\" --group CDC --spec \"cypress/integration/vendor/cdc/b2b/*.e2e.cy.ts\"", + "cy:run:ci:cdc-b2b": "cypress run --config-file cypress-b2b.ci.json --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers,API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --tag \"2211,cdc\" --group CDC --spec \"cypress/integration/vendor/cdc/b2b/*.e2e.cy.ts\"", "cy:run:ci:cdp": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://api.cg79x9wuu9-eccommerc1-s5-public.model-t.myhybris.cloud/ --tag \"2005,cdp\" --group CDP --spec \"cypress/e2e/vendor/cdp/*.e2e.cy.ts\"", "cy:run:ci:digital-payments": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://backoffice.cp96avkh5f-sapcxteam1-d5-public.model-t.cc.commerce.ondemand.com --tag \"2105,digital-payments\" --group DIGITAL-PAYMENTS --spec \"cypress/e2e/vendor/digital-payments/*.e2e.cy.ts\"", "cy:run:ci:s4-service": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --tag \"s4-service\" --group s4-service --spec \"cypress/e2e/vendor/s4-service/*.e2e.cy.ts\"", @@ -54,7 +54,7 @@ "cy:run:ci:vendor:product-configurator-vc": "cypress run --spec \"cypress/e2e/**/*-configurator*.*e2e.cy.ts\"", "cy:run:ci:vendor:asm": "cypress run --config-file cypress.config.ci.ts --spec \"cypress/e2e/vendor/asm/**/*e2e.cy.ts\"", "cy:run:ci:vendor:cds": "cypress run --config-file cypress.config.ci.ts --spec \"cypress/e2e/vendor/cds/**/*.core-e2e.cy.ts\"", - "cy:run:ci:vendor:cdc-b2b": "cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers,API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --spec \"cypress/integration/vendor/cdc/b2b/*.core-e2e.cy.ts\"", + "cy:run:ci:vendor:cdc-b2b": "cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers,API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --spec \"cypress/integration/vendor/cdc/b2b/*.core-e2e.cy.ts\"", "cy:run:ci:vendor:cdp": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://api.cg79x9wuu9-eccommerc1-s5-public.model-t.myhybris.cloud/ --spec \"cypress/e2e/vendor/cdp/*-e2e.cy.ts\"", "cy:run:ci:vendor:digital-payments": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://backoffice.cp96avkh5f-sapcxteam1-d5-public.model-t.cc.commerce.ondemand.com --spec \"cypress/e2e/vendor/digital-payments/*-e2e.cy.ts\"", "cy:run:ci:vendor:s4-service": "cypress run --config-file cypress.config.ci.ts --env API_URL=https://api.cg79x9wuu9-eccommerc1-s1-public.model-t.myhybris.cloud/ --spec \"cypress/e2e/vendor/s4-service/*-e2e.cy.ts\"", @@ -72,10 +72,10 @@ "cy:run:ci:vendor:s4om": "cypress run --config-file cypress.config.ci.ts --spec \"cypress/e2e/vendor/s4om/*.e2e.cy.ts\"", "cy:run:ci:vendor:punchout": "cypress run --config-file cypress.config.ci.ts --env PUNCHOUT=true --spec \"cypress/e2e/b2b/vendor/punchout/*.e2e.cy.ts\"", "cy:run:ci:release": "cypress run --config-file cypress.config.ci.ts --spec \"$(cat tests_to_run.txt)\" --reporter junit --reporter-options mochaFile=results/e2e-test-b2c-[hash].xml", - "cy:run:ci:b2b:release": "bash -c 'SPECS=$(cat tests_to_run.txt | tr \",\" \" \"); echo Running specs: $SPECS; npx cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec $SPECS --reporter junit --reporter-options mochaFile=results/e2e-test-b2b-[hash].xml'", + "cy:run:ci:b2b:release": "bash -c 'SPECS=$(cat tests_to_run.txt | tr \",\" \" \"); echo Running specs: $SPECS; npx cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec $SPECS --reporter junit --reporter-options mochaFile=results/e2e-test-b2b-[hash].xml'", "cy:run:ci:ssr:release": "cypress run --config-file cypress.config.ci.ts --config baseUrl=http://localhost:4000 --spec \"cypress/e2e/ssr/*.e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-ssr-[hash].xml", "cy:run:ci:a11y:release": "cypress run --config-file cypress.config.ci.ts --spec \"cypress/e2e/a11y/b2c/**/*.a11y-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-[hash].xml", - "cy:run:ci:a11y:b2b:release": "cypress run --config-file cypress.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-b2b-[hash].xml" + "cy:run:ci:a11y:b2b:release": "cypress run --config-file cypress-b2b.config.ci.ts --env BASE_SITE=powertools-spa,OCC_PREFIX_USER_ENDPOINT=orgUsers --spec \"cypress/e2e/a11y/b2b/**/*.a11y-e2e.cy.ts\" --reporter junit --reporter-options mochaFile=results/e2e-test-a11y-b2b-[hash].xml" }, "devDependencies": { "@babel/core": "^7.14.3", diff --git a/projects/storefrontapp/src/app/spartacus/spartacus-b2b-configuration.module.ts b/projects/storefrontapp/src/app/spartacus/spartacus-b2b-configuration.module.ts index be53f068b72..2089b0ae134 100644 --- a/projects/storefrontapp/src/app/spartacus/spartacus-b2b-configuration.module.ts +++ b/projects/storefrontapp/src/app/spartacus/spartacus-b2b-configuration.module.ts @@ -7,6 +7,7 @@ import { NgModule } from '@angular/core'; import { defaultB2BCheckoutConfig } from '@spartacus/checkout/b2b/root'; import { + AuthConfig, provideConfig, provideConfigFactory, SiteContextConfig, @@ -41,12 +42,22 @@ if (environment.epdVisualization) { baseSite: baseSite, }, }), + provideConfig({ + authentication: { + client_id: 'mobile_android_public_b2b', + }, + }), provideConfig({ pwa: { enabled: true, addToHomeScreen: true, }, }), + provideConfig({ + authentication: { + client_id: 'mobile_android_public_b2b', + }, + }), ], }) export class SpartacusB2bConfigurationModule {} diff --git a/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts b/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts index ee75e2de1ef..c1f062aa14b 100644 --- a/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts +++ b/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts @@ -372,7 +372,7 @@ if (environment.cpq) { reserveSpaceForImagesOnPdpAndPlp: true, lazyLoadImagesByDefault: true, incrementProcessesCountForMergeCart: true, - authorizationCodeFlowByDefault: false, + authorizationCodeFlowByDefault: true, defaultLayoutConfigWithoutPageFold: true, navigationMenuCloseOnSameLinkClick: true, enableQuotePurchaseOrderNumber: false,