diff --git a/projects/storefrontapp-e2e-cypress/cypress/e2e/accessibility/quote-tabbing.e2e.cy.ts b/projects/storefrontapp-e2e-cypress/cypress/e2e/accessibility/quote-tabbing.e2e.cy.ts new file mode 100644 index 00000000000..649a8d59575 --- /dev/null +++ b/projects/storefrontapp-e2e-cypress/cypress/e2e/accessibility/quote-tabbing.e2e.cy.ts @@ -0,0 +1,52 @@ +/* + * SPDX-FileCopyrightText: 2023 SAP Spartacus team + * + * SPDX-License-Identifier: Apache-2.0 + */ + +import { verifyTabbingOrder } from '../../helpers/accessibility/tabbing-order'; +import * as quote from '../../helpers/quote'; +import { clickAllowAllFromBanner } from '../../helpers/anonymous-consents'; +import { tabbingOrderConfig } from '../../helpers/accessibility/b2b/tabbing-order.config'; + +const containerSelectorQuoteDetails = 'main'; +const POWERTOOLS = 'powertools-spa'; +const TEST_PRODUCT_HAMMER_DRILLING_ID = '3887130'; +const BUYER_EMAIL = 'gi.sun@pronto-hw.com'; +const BUYER_PASSWORD = '12341234'; +const BUYER_USER = 'Gi Sun'; +const MSG_TYPE_WARNING = '[GlobalMessage] Warning'; +const PRODUCT_AMOUNT_30: number = 30; + +describe('Tabbing order for Quote', () => { + context('Quote', () => { + let globalMessageSettings: any; + beforeEach(() => { + globalMessageSettings = { + globalMessages: { + [MSG_TYPE_WARNING]: { + timeout: 10000, + }, + }, + }; + cy.cxConfig(globalMessageSettings); + cy.visit('/'); + clickAllowAllFromBanner(); + quote.login(BUYER_EMAIL, BUYER_PASSWORD, BUYER_USER); + quote.registerGetQuoteRoute(POWERTOOLS); + quote.prepareQuote( + POWERTOOLS, + TEST_PRODUCT_HAMMER_DRILLING_ID, + PRODUCT_AMOUNT_30, + true + ); + }); + + it('should allow to navigate with tab key within the quote details page', () => { + verifyTabbingOrder( + containerSelectorQuoteDetails, + tabbingOrderConfig.quoteDetailsPage + ); + }); + }); +}); diff --git a/projects/storefrontapp-e2e-cypress/cypress/helpers/accessibility/b2b/tabbing-order.config.ts b/projects/storefrontapp-e2e-cypress/cypress/helpers/accessibility/b2b/tabbing-order.config.ts index 49035811aa8..8c25e62e69f 100644 --- a/projects/storefrontapp-e2e-cypress/cypress/helpers/accessibility/b2b/tabbing-order.config.ts +++ b/projects/storefrontapp-e2e-cypress/cypress/helpers/accessibility/b2b/tabbing-order.config.ts @@ -519,4 +519,62 @@ export const tabbingOrderConfig: TabbingOrderConfig = { type: TabbingOrderTypes.LINK, }, ], + quoteDetailsPage: [ + { + value: 'New Cart', + type: TabbingOrderTypes.LINK, + }, + { + value: 'Quotes', + type: TabbingOrderTypes.LINK, + }, + { + type: TabbingOrderTypes.BUTTON, + }, + { + value: 'Contact', + type: TabbingOrderTypes.LINK, + }, + { + value: 'All Products', + type: TabbingOrderTypes.SELECT, + }, + { + type: TabbingOrderTypes.GENERIC_INPUT, + }, + { + value: 'Send', + type: TabbingOrderTypes.BUTTON, + }, + { + value: 'Cart', + type: TabbingOrderTypes.LINK, + }, + { + type: TabbingOrderTypes.IMG_LINK, + }, + { + type: TabbingOrderTypes.LINK, + }, + { + value: '-', + type: TabbingOrderTypes.BUTTON, + }, + { + type: TabbingOrderTypes.GENERIC_INPUT, + }, + { value: '+', type: TabbingOrderTypes.BUTTON }, + { + value: 'Remove', + type: TabbingOrderTypes.BUTTON, + }, + { + value: 'Submit Quote', + type: TabbingOrderTypes.BUTTON, + }, + { + value: 'Cancel Quote', + type: TabbingOrderTypes.BUTTON, + }, + ], };