Skip to content

Commit

Permalink
E2e quote details page tabbing test (#17974)
Browse files Browse the repository at this point in the history
Co-authored-by: Ulrich Stellmacher <[email protected]>
Co-authored-by: steinsebastian <[email protected]>
  • Loading branch information
3 people authored Oct 24, 2023
1 parent aa3e366 commit b0a1583
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
*
* 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 = '[email protected]';
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
);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
};

0 comments on commit b0a1583

Please sign in to comment.