Skip to content

Commit af7f0e7

Browse files
authored
[PM-19462] Update a11y testing (#321)
* update web fixture login * update web client a11y test paths * update browser client a11y test paths
1 parent 9527fdc commit af7f0e7

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

constants/browser-client-views.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
export const browserClientViewPaths = new Set([
2-
"register",
3-
"home",
4-
"environment",
2+
"signup",
3+
"hint",
54
65
"account-switcher",
7-
"add-cipher",
6+
"add-cipher?type=1",
7+
"add-cipher?type=2",
8+
"add-cipher?type=3",
9+
"add-cipher?type=4",
10+
"add-cipher?type=5",
11+
"add-cipher?type=6",
812
"tabs/vault",
913
"tabs/send",
10-
"add-send",
14+
"add-send?type=1",
15+
"add-send?type=2",
1116
"tabs/generator",
1217
"generator-history",
1318
"tabs/settings",
1419
"account-security",
1520
"autofill",
21+
"blocked-domains",
1622
"notifications",
1723
"excluded-domains",
1824
"folders",
1925
"vault-settings",
2026
"export",
27+
"trash",
2128
"appearance",
2229
"about",
2330
"more-from-bitwarden",
2431
"premium",
32+
"lock",
2533
]);
26-
27-
export const browserClientViewPathsRefreshUI = new Set(["lockV2", "trash"]);

constants/web-client-views.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@ export const authenticatedWebClientViewPaths = new Set([
77
"tools/export",
88
"reports",
99
"reports/breach-report",
10+
"reports/exposed-passwords-report",
11+
"reports/reused-passwords-report",
12+
"reports/weak-passwords-report",
13+
"reports/unsecured-websites-report",
14+
"reports/inactive-two-factor-report",
1015
"settings/account",
1116
"settings/security/change-password",
1217
"settings/security/two-factor",
18+
"settings/security/device-management",
1319
"settings/security/security-keys",
1420
"settings/preferences",
15-
"settings/subscription/premium",
21+
"settings/subscription/premium", // # non-premium accounts only
1622
"settings/domain-rules",
1723
"settings/emergency-access",
1824
"settings/sponsored-families",
1925
"create-organization",
26+
// @TODO secrets manager & admin console
2027
]);
2128

2229
export const unauthenticatedWebClientViewPaths = new Set([

tests/a11y/browser-client.spec.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
browserClientViewPaths,
3-
browserClientViewPathsRefreshUI,
43
debugIsActive,
54
messageColor,
65
} from "../../constants";
@@ -12,18 +11,14 @@ test.describe("Browser client", { tag: ["@browser-client", "@a11y"] }, () => {
1211
extensionId,
1312
extensionSetup,
1413
}, testInfo) => {
15-
const urlSharedPathBase = "popout#/";
16-
const urlBase = `chrome-extension://${extensionId}/popup/index.html?uilocation=popout#/`;
14+
const urlSharedPathBase = "#/";
15+
const urlBase = `chrome-extension://${extensionId}/popup/index.html${urlSharedPathBase}`;
1716

1817
let testPage = await extensionSetup;
1918
let violationsCount = 0;
20-
let viewPaths = [
21-
...browserClientViewPaths,
22-
...browserClientViewPathsRefreshUI,
23-
];
2419

2520
// Note: if a path is nonexistent, it will load to the vault tab and evaluate that
26-
for (const viewPath of viewPaths) {
21+
for (const viewPath of browserClientViewPaths) {
2722
await test.step(`for path: \`${urlSharedPathBase}${viewPath}\``, async () => {
2823
const newViolationsCount = await a11yTestView({
2924
testInfo,
@@ -36,7 +31,7 @@ test.describe("Browser client", { tag: ["@browser-client", "@a11y"] }, () => {
3631
await expect
3732
.soft(
3833
newViolationsCount,
39-
`view for \`popout#/${viewPath}\` should yield 0 violations`,
34+
`view for \`${urlSharedPathBase}${viewPath}\` should yield 0 violations`,
4035
)
4136
.toEqual(0);
4237

tests/fixtures.web.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ export const test = base.extend<{
7676
const emailSubmitInput = await testPage.getByRole("button");
7777
await emailSubmitInput.click();
7878

79-
const masterPasswordInput = await testPage.locator(
80-
"input#login_input_master-password",
81-
);
79+
const masterPasswordInput = await testPage.getByLabel("Master password");
8280
await masterPasswordInput.waitFor(defaultWaitForOptions);
8381
await masterPasswordInput.fill(vaultPassword);
8482

0 commit comments

Comments
 (0)