-
Notifications
You must be signed in to change notification settings - Fork 403
fix: add Continuum E2Es for B2B My Company #20341
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
Changes from 5 commits
b9e9c0a
043e112
b7d5f79
da66ddf
6095f62
dd70972
9b93647
8142c79
5032a42
4d8e3a4
a0cdd47
1efe0af
c5d3da2
0da8fe1
3586bcf
63dfe6c
2c19682
0ef5b51
ba0bbdb
f5aef90
23567ae
961cfa1
9c3d9ba
d6ce479
c876c17
23bd9bc
ebcef7f
74f28d8
b232210
24eff28
da16874
bea9d57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]> | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { loginAsMyCompanyAdmin } from '../../helpers/b2b/my-company/my-company.utils'; | ||
|
|
||
| const MY_COMPANY_URL = '/organization/account-summary'; | ||
|
|
||
| /** | ||
| * This test checks accessibility concerns on the B2B My Company Account Summaries page using Access Continuum | ||
| */ | ||
| describe( | ||
| 'B2B / My Company / Account Summaries / Page Accessibility', | ||
| { testIsolation: false }, | ||
| () => { | ||
| before(() => { | ||
| cy.a11yContinuumSetup(); | ||
| loginAsMyCompanyAdmin(); | ||
| cy.visit(MY_COMPANY_URL); | ||
| }); | ||
|
|
||
| it('initial page load', () => { | ||
| cy.get('main cx-view cx-table table'); | ||
| cy.get('main').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('page loaded', () => { | ||
| cy.get('#Rustic'); | ||
| cy.get('main').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('account summaries details / initial panel', () => { | ||
|
||
| cy.get('#Rustic').click(); | ||
| cy.get( | ||
| 'cx-account-summary-header .cx-summary-card-group-unit-address .cx-card-title' | ||
| ); | ||
| cy.get('main').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| // it('account summaries details / edit panel', () => { | ||
|
||
| // cy.get( | ||
| // 'cx-org-unit-details cx-org-card cx-view .header .actions .btn.edit' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-details cx-org-card cx-view .main .details input'); | ||
| // cy.get('cx-org-unit-details').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / edit-save panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-details cx-org-card cx-view .header .actions .btn.btn-primary' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-details cx-org-card cx-view .main cx-org-notification' | ||
| // ); | ||
| // cy.get( | ||
| // 'cx-org-unit-details cx-org-card cx-view .main .details .property a[href="/powertools-spa/en/USD/organization/units/Rustic"]' | ||
| // ); | ||
| // cy.get('cx-org-unit-details').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / links list / child units panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main .link-list a.link:nth-child(1)' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-children cx-org-sub-list cx-org-card cx-view .main cx-table table cx-org-unit-details-cell button' | ||
| // ); | ||
| // cy.get( | ||
| // 'cx-org-unit-children cx-org-sub-list cx-org-card cx-view .main cx-table table tr:nth-child(2) cx-org-unit-details-cell button' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-details').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / links list / child units / create panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-details cx-org-unit-children .header .actions .btn' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-details cx-org-unit-children .main input'); | ||
| // cy.get('cx-org-unit-details').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / users list panel', () => { | ||
| // // TODO: save as rusticServicesBreadcrumb and reuse elsewhere! | ||
| // cy.get( | ||
| // 'cx-breadcrumb a[href="/powertools-spa/en/USD/organization/units/Rustic%20Services"]' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main .link-list a.link:nth-child(2)' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main cx-table table tr:nth-child(2) td.roles a' | ||
| // ); | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main cx-table table tr:nth-child(2) button' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-details').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / users list / roles and rights panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main cx-table table tr:nth-child(2) td.roles a' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-user-roles form input'); | ||
| // cy.get('cx-org-unit-details').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / approvers list panel', () => { | ||
| // // TODO: save as rusticServicesBreadcrumb and reuse elsewhere! | ||
| // cy.get( | ||
| // 'cx-breadcrumb a[href="/powertools-spa/en/USD/organization/units/Rustic%20Services"]' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main .link-list a.link:nth-child(3)' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-assigned-approver-list cx-org-sub-list .main .is-empty' | ||
| // ); | ||
| // cy.get('cx-org-unit-assigned-approver-list').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / approvers list / manage approvers panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-assigned-approver-list cx-org-sub-list .header .btn:first-child' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-approver-list cx-org-sub-list cx-table table tr:nth-child(2) td.orgUnit span[title="Services East"]' | ||
| // ); | ||
| // cy.get( | ||
| // 'cx-org-unit-approver-list cx-org-sub-list cx-table table tr:nth-child(2) cx-org-user-details-cell button' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-approver-list').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / approvers list / manage approvers assign panel', () => { | ||
| // // Assign button click | ||
| // cy.get( | ||
| // 'cx-org-unit-approver-list cx-org-sub-list cx-table table tr:nth-child(2) cx-org-assign-cell button' | ||
| // ).click(); | ||
| // cy.get('cx-global-message .alert-danger'); | ||
| // cy.get('body').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / delivery addresses list panel', () => { | ||
| // // TODO: save as rusticServicesBreadcrumb and reuse elsewhere! | ||
| // cy.get( | ||
| // 'cx-breadcrumb a[href="/powertools-spa/en/USD/organization/units/Rustic%20Services"]' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main .link-list a.link:nth-child(4)' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-address-list cx-org-sub-list .main .is-empty'); | ||
| // cy.get('cx-org-unit-address-list').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / delivery addresses list / create panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-address-list cx-org-sub-list .header .btn:first-child' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-address-list cx-org-sub-list input'); | ||
| // cy.get('cx-org-unit-address-list').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / const centers list panel', () => { | ||
| // // TODO: save as rusticServicesBreadcrumb and reuse elsewhere! | ||
| // cy.get( | ||
| // 'cx-breadcrumb a[href="/powertools-spa/en/USD/organization/units/Rustic%20Services"]' | ||
| // ).click(); | ||
| // cy.get( | ||
| // 'cx-org-unit-details .main .link-list a.link:nth-child(5)' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-cost-centers cx-org-sub-list .main .is-empty'); | ||
| // cy.get('cx-org-unit-cost-centers').a11yRunContinuumTest(); | ||
| // }); | ||
|
|
||
| // it('unit details / const centers list / create panel', () => { | ||
| // cy.get( | ||
| // 'cx-org-unit-cost-centers cx-org-sub-list .header .btn:first-child' | ||
| // ).click(); | ||
| // cy.get('cx-org-unit-cost-centers cx-org-sub-list input'); | ||
| // cy.get('cx-org-unit-cost-centers').a11yRunContinuumTest(); | ||
| // }); | ||
| } | ||
| ); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]> | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { loginAsMyCompanyAdmin } from '../../helpers/b2b/my-company/my-company.utils'; | ||
|
|
||
| const MY_COMPANY_URL = '/organization/budgets'; | ||
| const rowCellSelector = | ||
| 'cx-org-list.orgBudget table tr:nth-child(2) cx-org-status-cell span'; | ||
| const detailsActionsListSelector = 'cx-org-list.orgBudget .main .link-list'; | ||
|
|
||
| /** | ||
| * This test checks accessibility concerns on the B2B My Company Budgets page using Access Continuum | ||
| */ | ||
| describe( | ||
| 'B2B / My Company / Budgets / Page Accessibility', | ||
| { testIsolation: false }, | ||
| () => { | ||
| before(() => { | ||
| cy.a11yContinuumSetup(); | ||
| loginAsMyCompanyAdmin(); | ||
| cy.visit(MY_COMPANY_URL); | ||
| }); | ||
|
|
||
| it('list page loaded', () => { | ||
| cy.get(rowCellSelector); | ||
| cy.get('main').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('budgets / initial panel', () => { | ||
| cy.get(rowCellSelector).click(); | ||
| cy.get( | ||
| 'cx-org-budget-details cx-org-card cx-view .main .details .property .value' | ||
| ); | ||
| cy.get('cx-org-budget-details').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('budgets / edit panel', () => { | ||
| const editdLink = 'cx-org-budget-details .header .actions a.edit'; | ||
| cy.get(editdLink).click(); | ||
| cy.get('cx-org-budget-details cx-org-budget-form form input'); | ||
| cy.get('cx-org-budget-details').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('budgets / const centers panel', () => { | ||
| cy.get(`${detailsActionsListSelector} a:nth-child(1)`).click(); | ||
| cy.get( | ||
| 'cx-org-budget-cost-center-list table cx-org-cost-center-details-cell button' | ||
| ).click(); | ||
| cy.get('cx-org-budget-details').a11yRunContinuumTest(); | ||
| }); | ||
| } | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]> | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { loginAsMyCompanyAdmin } from '../../helpers/b2b/my-company/my-company.utils'; | ||
|
|
||
| const MY_COMPANY_URL = '/organization/cost-centers'; | ||
| const rowCellSelector = | ||
| 'main cx-view cx-table table tr:nth-child(2) .unit cx-org-unit-cell [title="Custom Retail"]'; | ||
| const detailsActionsListSelector = | ||
| 'cx-org-cost-center-details .main .link-list'; | ||
|
|
||
| /** | ||
| * This test checks accessibility concerns on the B2B My Company Cost Centers page using Access Continuum | ||
| */ | ||
| describe( | ||
| 'B2B / My Company / Cost Centers / Page Accessibility', | ||
| { testIsolation: false }, | ||
| () => { | ||
| before(() => { | ||
| cy.a11yContinuumSetup(); | ||
| loginAsMyCompanyAdmin(); | ||
| cy.visit(MY_COMPANY_URL); | ||
| }); | ||
|
|
||
| it('list page loaded', () => { | ||
| cy.get(rowCellSelector); | ||
| cy.get('main').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('cost centers / initial panel', () => { | ||
| cy.get(rowCellSelector).click(); | ||
| cy.get( | ||
| 'cx-org-cost-center-details cx-org-card cx-view .main .details .property .value' | ||
| ); | ||
| cy.get('cx-org-cost-center-details').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('cost centers / edit panel', () => { | ||
| const editdLink = 'cx-org-cost-center-details .header .actions a.edit'; | ||
| cy.get(editdLink).click(); | ||
| cy.get('cx-org-cost-center-details cx-org-cost-center-form form input'); | ||
| cy.get('cx-org-cost-center-details').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('cost centers / budgets panel', () => { | ||
| cy.get(`${detailsActionsListSelector} a:nth-child(1)`).click(); | ||
| cy.get( | ||
| 'cx-org-cost-center-assigned-budget-list table cx-org-assign-cell button' | ||
| ); | ||
| cy.get( | ||
| 'cx-org-cost-center-assigned-budget-list table cx-org-budget-details-cell button' | ||
| ).click(); | ||
| cy.get('cx-org-cost-center-details').a11yRunContinuumTest(); | ||
| }); | ||
|
|
||
| it('cost centers / budgets / manage budgets panel', () => { | ||
| const manageLink = | ||
| 'cx-org-cost-center-assigned-budget-list .header .actions a.btn'; | ||
| cy.get(manageLink).click(); | ||
| const assignButtonCell = | ||
| 'cx-org-cost-center-budget-list .main table tr:nth-child(2) cx-org-assign-cell button'; | ||
| cy.get(assignButtonCell); | ||
| cy.get('cx-org-cost-center-budget-list').a11yRunContinuumTest(); | ||
| }); | ||
| } | ||
| ); |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't running the scan after the page is fully loaded sufficient? I've seen this repeated in the other files too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well in first case its testing skeleton components (where content isn't loaded still) - which in few cases had a11y issues caught by continuum. The second one is validating loaded state (actual table with data).
If this isn't required I can remove the fist one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing the skeleton makes sense I would keep it. Let's replace 'initial page load' with sth that makes it clear that the skeleton is the target. At the same time, we need to make sure the skeleton is actually present for the test. Is there a way we could avoid the possible race condition here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed!