Commit 445fac21 authored by Jack Lynch's avatar Jack Lynch Committed by Commit Bot

DevTools: Add axe accessibility test for the watch expressions pane

This adds an axe test for the watch expressions pane and is dependent
on https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1884528

Bug: 963183
Change-Id: Ib43e9494d8ffa1ac825a6824a34b32d9d3095625
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1652369
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715068}
parent edee1ef9
Adding watch expression.
Running the axe-core linter on the empty watch pane.
aXe violations: []
Watch expression text content: 2 + 2 === 5: false
Running the axe-core linter on the watch expression.
aXe violations: []
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('elements_test_runner');
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.navigatePromise('../sources/debugger-breakpoints/resources/dom-breakpoints.html');
await UI.viewManager.showView('sources.watch');
TestRunner.addResult('Adding watch expression.');
const watchPane = self.runtime.sharedInstance(Sources.WatchExpressionsSidebarPane);
watchPane.doUpdate();
TestRunner.addResult('Running the axe-core linter on the empty watch pane.');
await AxeCoreTestRunner.runValidation(watchPane.contentElement);
const watchExpression = watchPane._createWatchExpression('2 + 2 === 5');
await TestRunner.addSnifferPromise(Sources.WatchExpression.prototype, '_createWatchExpression');
const watchExpressionElement = watchExpression.treeElement().listItemElement;
TestRunner.addResult(`Watch expression text content: ${watchExpressionElement.deepTextContent()}`);
TestRunner.addResult('Running the axe-core linter on the watch expression.');
await AxeCoreTestRunner.runValidation(watchExpressionElement);
TestRunner.completeTest();
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment