Path: blob/main/test/smoke/src/areas/accessibility/accessibility.test.ts
4778 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Application, Logger } from '../../../../automation';6import { installAllHandlers } from '../../utils';78export function setup(logger: Logger, opts: { web?: boolean }) {9describe.skip('Accessibility', function () {1011// Increase timeout for accessibility scans12this.timeout(30 * 1000);1314// Retry tests to minimize flakiness15this.retries(2);1617// Shared before/after handling18installAllHandlers(logger);1920let app: Application;2122before(async function () {23app = this.app as Application;24});2526describe('Workbench', function () {2728(opts.web ? it.skip : it)('workbench has no accessibility violations', async function () {29// Wait for workbench to be fully loaded30await app.code.waitForElement('.monaco-workbench');3132await app.code.driver.assertNoAccessibilityViolations({33selector: '.monaco-workbench',34excludeRules: {35// Links in chat welcome view show underline on hover/focus which axe-core static analysis cannot detect36'link-in-text-block': ['command:workbench.action.chat.generateInstructions'],37// Monaco lists use aria-multiselectable on role="list" and aria-setsize/aria-posinset/aria-selected on role="dialog" rows38// These violations appear intermittently when notification lists or other dynamic lists are visible39// Note: patterns match against HTML string, not CSS selectors, so no leading dots40'aria-allowed-attr': ['monaco-list', 'monaco-list-row']41}42});43});4445it('activity bar has no accessibility violations', async function () {46await app.code.waitForElement('.activitybar');4748await app.code.driver.assertNoAccessibilityViolations({49selector: '.activitybar'50});51});5253it('sidebar has no accessibility violations', async function () {54await app.code.waitForElement('.sidebar');5556await app.code.driver.assertNoAccessibilityViolations({57selector: '.sidebar'58});59});6061it('status bar has no accessibility violations', async function () {62await app.code.waitForElement('.statusbar');6364await app.code.driver.assertNoAccessibilityViolations({65selector: '.statusbar'66});67});68});6970// Chat is not available in web mode71if (!opts.web) {72describe('Chat', function () {7374it('chat panel has no accessibility violations', async function () {75// Open chat panel76await app.workbench.quickaccess.runCommand('workbench.action.chat.open');7778// Wait for chat view to be visible79await app.code.waitForElement('div[id="workbench.panel.chat"]');8081await app.code.driver.assertNoAccessibilityViolations({82selector: 'div[id="workbench.panel.chat"]',83excludeRules: {84// Links in chat welcome view show underline on hover/focus which axe-core static analysis cannot detect85'link-in-text-block': ['command:workbench.action.chat.generateInstructions']86}87});88});89});90}91});92}939495