Commit 1da9c254 authored by Jack Lynch's avatar Jack Lynch Committed by Commit Bot

DevTools: Add axe test for Changes drawer

This adds an axe test for the accessibility changes in #1659355. The
test is in a separate PR from the changes because of the flaky axe test
issue which should be fixed by #1638125.

Bug: 963183
Change-Id: Ibc3dbd8dd954e2493521bef48abdb65a802a91ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666445
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Auto-Submit: Jack Lynch <jalyn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#677600}
parent 8993a717
Tests accessibility in the Changes drawer.
Loading files to compare.
Showing the Changes drawer.
Editor text content:
.will-be-deleted-but-will-show-modified-because-first-line {
width: 10px;
height: 10px;
}
.stays-the-same {
font-size: 10px;
font-family: sans-serif;
}
.will-be-modified {
height: 100000%;
.was-modified {
width: 0%;
}
.stays-the-same2 {
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
}
.was-added {
color: #00F;
color: #008;
color: #000;
}
.stays-the-same3 {
font-size: 15px;
font-family: Arial, Helvetica, sans-serif;
}
.will-lose-properties {
background: #000;
background: #400;
background: #800;
background: #B00;
background: #F00;
}
Running aXe on the Changes drawer.
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() {
TestRunner.addResult('Tests accessibility in the Changes drawer.');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('changes');
await TestRunner.showPanel('sources');
await TestRunner.addStylesheetTag('../../changes/resources/before.css');
await TestRunner.addStylesheetTag('../../changes/resources/after.css');
TestRunner.addResult('Loading files to compare.');
const beforeSource = await TestRunner.waitForUISourceCode('before.css');
const afterSource = await TestRunner.waitForUISourceCode('after.css');
const content = await afterSource.requestContent();
beforeSource.setWorkingCopy(content);
TestRunner.addResult('Showing the Changes drawer.');
await UI.viewManager.showView('changes.changes');
const changesWidget = await UI.viewManager.view('changes.changes').widget();
await TestRunner.addSnifferPromise(changesWidget, '_renderDiffRows');
TestRunner.addResult(`Editor text content:\n${changesWidget._editor.text()}`);
TestRunner.addResult('Running aXe on the Changes drawer.');
await AxeCoreTestRunner.runValidation(changesWidget.contentElement);
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