Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/smoke/src/areas/accessibility/accessibility.test.ts
4778 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Application, Logger } from '../../../../automation';
7
import { installAllHandlers } from '../../utils';
8
9
export function setup(logger: Logger, opts: { web?: boolean }) {
10
describe.skip('Accessibility', function () {
11
12
// Increase timeout for accessibility scans
13
this.timeout(30 * 1000);
14
15
// Retry tests to minimize flakiness
16
this.retries(2);
17
18
// Shared before/after handling
19
installAllHandlers(logger);
20
21
let app: Application;
22
23
before(async function () {
24
app = this.app as Application;
25
});
26
27
describe('Workbench', function () {
28
29
(opts.web ? it.skip : it)('workbench has no accessibility violations', async function () {
30
// Wait for workbench to be fully loaded
31
await app.code.waitForElement('.monaco-workbench');
32
33
await app.code.driver.assertNoAccessibilityViolations({
34
selector: '.monaco-workbench',
35
excludeRules: {
36
// Links in chat welcome view show underline on hover/focus which axe-core static analysis cannot detect
37
'link-in-text-block': ['command:workbench.action.chat.generateInstructions'],
38
// Monaco lists use aria-multiselectable on role="list" and aria-setsize/aria-posinset/aria-selected on role="dialog" rows
39
// These violations appear intermittently when notification lists or other dynamic lists are visible
40
// Note: patterns match against HTML string, not CSS selectors, so no leading dots
41
'aria-allowed-attr': ['monaco-list', 'monaco-list-row']
42
}
43
});
44
});
45
46
it('activity bar has no accessibility violations', async function () {
47
await app.code.waitForElement('.activitybar');
48
49
await app.code.driver.assertNoAccessibilityViolations({
50
selector: '.activitybar'
51
});
52
});
53
54
it('sidebar has no accessibility violations', async function () {
55
await app.code.waitForElement('.sidebar');
56
57
await app.code.driver.assertNoAccessibilityViolations({
58
selector: '.sidebar'
59
});
60
});
61
62
it('status bar has no accessibility violations', async function () {
63
await app.code.waitForElement('.statusbar');
64
65
await app.code.driver.assertNoAccessibilityViolations({
66
selector: '.statusbar'
67
});
68
});
69
});
70
71
// Chat is not available in web mode
72
if (!opts.web) {
73
describe('Chat', function () {
74
75
it('chat panel has no accessibility violations', async function () {
76
// Open chat panel
77
await app.workbench.quickaccess.runCommand('workbench.action.chat.open');
78
79
// Wait for chat view to be visible
80
await app.code.waitForElement('div[id="workbench.panel.chat"]');
81
82
await app.code.driver.assertNoAccessibilityViolations({
83
selector: 'div[id="workbench.panel.chat"]',
84
excludeRules: {
85
// Links in chat welcome view show underline on hover/focus which axe-core static analysis cannot detect
86
'link-in-text-block': ['command:workbench.action.chat.generateInstructions']
87
}
88
});
89
});
90
});
91
}
92
});
93
}
94
95