Skip to content

feat: (CXSPA-9810) - Add access continuum test for Express-Checkout #20238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const defaultCheckoutConfig: CheckoutConfig = {
type: [CheckoutStepType.REVIEW_ORDER],
},
],
express: false,
express: true,
defaultDeliveryMode: [DeliveryModePreferences.FREE],
guest: false,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { CheckoutConfig } from '@spartacus/storefront';
import * as checkout from '../../helpers/checkout-flow';
import * as expressCheckout from '../../helpers/express-checkout';
import { viewportContext } from '../../helpers/viewport-context';
import { clearAllStorage } from '../../support/utils/clear-all-storage';
import { isolateTestsBefore } from '../../support/utils/test-isolation';

describe('Express Checkout Accessibility', { testIsolation: false }, () => {
viewportContext(['mobile', 'desktop'], () => {
isolateTestsBefore();

before(() => {
clearAllStorage();
cy.a11yContinuumSetup();
cy.cxConfig({ checkout: { express: true } } as CheckoutConfig);
checkout.visitHomePage();
});

beforeEach(() => {
cy.restoreLocalStorage();
});

afterEach(() => {
cy.saveLocalStorage();
});

it('should show Shipping Address step when no default address/payment set', () => {
expressCheckout.testExpressCheckout();
cy.get('main').a11yRunContinuumTest();
});

it('should skip to Review step after setting address and payment', () => {
checkout.fillAddressFormWithCheapProduct();
checkout.verifyDeliveryOptions();
checkout.fillPaymentFormWithCheapProduct(undefined, undefined, true);

cy.get('main').a11yRunContinuumTest();
});

it('should correctly display Review page after default delivery mode change', () => {
cy.cxConfig({
checkout: {
express: true,
defaultDeliveryMode: ['MOST_EXPENSIVE'],
},
} as CheckoutConfig);

checkout.visitHomePage();
cy.get('cx-mini-cart').click();
cy.findByText(/proceed to checkout/i).click();
cy.get('main').a11yRunContinuumTest();
});
});
});