Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b9e9c0a
fix: add b2b mycompany a11y e2e tests
ulates-sap May 20, 2025
043e112
fix: adding more tests
ulates-sap May 20, 2025
b7d5f79
fix: fix failed unit tests
ulates-sap May 20, 2025
da66ddf
Trigger Build
ulates-sap May 21, 2025
6095f62
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates May 22, 2025
dd70972
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates May 26, 2025
9b93647
fix: address PR comments
ulates-sap May 26, 2025
8142c79
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates May 27, 2025
5032a42
fix: address PR comments - initial skeleton
ulates-sap May 27, 2025
4d8e3a4
fix: address PR comment
ulates-sap May 27, 2025
a0cdd47
fix: address PR comment
ulates-sap May 27, 2025
1efe0af
fix: address PR comments
ulates-sap May 28, 2025
c5d3da2
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates May 28, 2025
0da8fe1
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates May 28, 2025
3586bcf
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 2, 2025
63dfe6c
fix: address PR comments
ulates-sap Jun 2, 2025
2c19682
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 3, 2025
0ef5b51
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 4, 2025
ba0bbdb
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 5, 2025
f5aef90
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 6, 2025
23567ae
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 23, 2025
961cfa1
fix: fix purchase-limits test
ulates-sap Jun 23, 2025
9c3d9ba
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 24, 2025
d6ce479
fix: remove problematic test and move files to new location
ulates-sap Jun 24, 2025
c876c17
Trigger Build
ulates-sap Jun 24, 2025
23bd9bc
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 26, 2025
ebcef7f
fix: fix faield tests
ulates-sap Jun 30, 2025
74f28d8
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jun 30, 2025
b232210
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jul 1, 2025
24eff28
fix: fix faield tests
ulates-sap Jul 1, 2025
da16874
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jul 2, 2025
bea9d57
Merge branch 'develop' into feature/CXSPA-10033-b2b-mycompany
uroslates Jul 2, 2025
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 @@ -13,6 +13,11 @@ <h2 id="regionTitle">
[documentTypeOptions]="documentTypeOptions"
[initialFilters]="_queryParams"
(filterListEvent)="filterChange($event)"
[cxNgSelectA11yAriaControls]="
(accountSummary.orgDocuments ?? []).length > 0
? 'cx-account-summary-document-table'
: undefined
"
>
</cx-account-summary-document-filter>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
bindValue="code"
[cxNgSelectA11y]="{
ariaLabel: 'orgAccountSummary.filter.status' | cxTranslate,
ariaControls: 'cx-account-summary-document-table',
ariaControls: cxNgSelectA11yAriaControls,
}"
>
</ng-select>
Expand Down Expand Up @@ -139,7 +139,7 @@
bindValue="code"
[cxNgSelectA11y]="{
ariaLabel: 'orgAccountSummary.filter.filterBy' | cxTranslate,
ariaControls: 'cx-account-summary-document-table',
ariaControls: cxNgSelectA11yAriaControls,
}"
>
</ng-select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ interface GroupValidator {
export class AccountSummaryDocumentFilterComponent
implements OnInit, OnDestroy
{
@Input()
cxNgSelectA11yAriaControls?: string;

@Input()
documentTypeOptions: Array<AccountSummaryDocumentType>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h4>
</div>

<div class="main">
<cx-org-message aria-aromic="true" aria-live="assertive"></cx-org-message>
<cx-org-message aria-live="assertive"></cx-org-message>
<ng-content select="[info]"></ng-content>
<ng-content select="[main]"></ng-content>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
<label>{{ 'orgUnit.parentUnit' | cxTranslate }}</label>
<a
class="value"
[ariaLabel]="
model.parentOrgUnit?.name ?? ('orgUnit.parentUnit' | cxTranslate)
"
[routerLink]="
{
cxRoute: 'orgUnitDetails',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<form *ngIf="form$ | async as form" [formGroup]="form" (submit)="save(form)">
<cx-form-required-legend />
<cx-org-card
[previous]="false"
i18nRoot="orgUser.password"
Expand All @@ -18,6 +17,8 @@
</button>

<section main class="details">
<cx-form-required-legend />

<label class="full-width">
<span class="label-content"
>{{ 'orgUser.password.newPassword' | cxTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

<button
class="button btn btn-sm text"
ariaLabel="{model?.name ?? ('orgUser.name' | cxTranslate)}"
[cxPopover]="details"
[cxPopoverOptions]="{
placement: 'auto',
Expand Down
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();
});
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed!


it('account summaries details / initial panel', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also include a test with the document list populated. The one tested here is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any that has documents. They are all empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Custom Retail? I definitely see some 😉
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks. Applied!

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the commented code be cleaned up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied!

// 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();
});
}
);
Loading