mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 20:11:38 +08:00
DISABLE_THIRD_PARTY_CHECK=big clang format run against all files in front_end and test/ Bug: 1319340 Change-Id: I1fff63cb07544ccd0e3059fc901f9a48ff4af13b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598879 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
76 lines
3.3 KiB
TypeScript
76 lines
3.3 KiB
TypeScript
// Copyright 2021 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.
|
|
|
|
import {
|
|
assertNotNullOrUndefined,
|
|
click,
|
|
enableExperiment,
|
|
getBrowserAndPages,
|
|
goToResource,
|
|
waitForAria,
|
|
waitForNone,
|
|
} from '../../shared/helper.js';
|
|
import {describe, it} from '../../shared/mocha-extensions.js';
|
|
import {toggleAccessibilityTree} from '../helpers/elements-helpers.js';
|
|
|
|
describe('Accessibility Tree in the Elements Tab', async function() {
|
|
it('displays the fuller accessibility tree', async () => {
|
|
await enableExperiment('fullAccessibilityTree');
|
|
await goToResource('elements/accessibility-simple-page.html');
|
|
await toggleAccessibilityTree();
|
|
await waitForAria('heading\xa0"Title" [role="treeitem"]');
|
|
await waitForAria('link\xa0"cats"\xa0focusable:\xa0true[role="treeitem"]');
|
|
});
|
|
|
|
it('allows navigating iframes', async () => {
|
|
await enableExperiment('fullAccessibilityTree');
|
|
await goToResource('elements/accessibility-iframe-page.html');
|
|
await toggleAccessibilityTree();
|
|
void waitForAria('RootWebArea\xa0"Page with nested iframe" [role="treeitem"]');
|
|
const iframeDoc = await waitForAria(
|
|
'RootWebArea\xa0"Simple page with aria labeled element"\xa0focusable:\xa0true [role="treeitem"]');
|
|
assertNotNullOrUndefined(iframeDoc);
|
|
await click('.arrow-icon', {root: iframeDoc});
|
|
await waitForAria('link\xa0"cats"\xa0focusable:\xa0true[role="treeitem"]');
|
|
});
|
|
|
|
it('listens for text changes to DOM and redraws the tree', async () => {
|
|
await enableExperiment('fullAccessibilityTree');
|
|
await goToResource('elements/accessibility-simple-page.html');
|
|
await toggleAccessibilityTree();
|
|
const {target} = getBrowserAndPages();
|
|
await waitForAria('link\xa0"cats"\xa0focusable:\xa0true[role="treeitem"]');
|
|
const link = await target.waitForSelector('aria/cats [role="link"]');
|
|
assertNotNullOrUndefined(link);
|
|
await link.evaluate(node => {
|
|
(node as HTMLElement).innerText = 'dogs';
|
|
});
|
|
await waitForAria('link\xa0"dogs"\xa0focusable:\xa0true[role="treeitem"]');
|
|
});
|
|
|
|
it('listens for changes to properties and redraws tree', async () => {
|
|
await enableExperiment('fullAccessibilityTree');
|
|
await goToResource('elements/accessibility-simple-page.html');
|
|
await toggleAccessibilityTree();
|
|
const {target} = getBrowserAndPages();
|
|
const link = await target.waitForSelector('aria/cats [role="link"]');
|
|
assertNotNullOrUndefined(link);
|
|
await waitForAria('link\xa0"cats"\xa0focusable:\xa0true[role="treeitem"]');
|
|
await link.evaluate(node => node.setAttribute('aria-label', 'birds'));
|
|
await waitForAria('link\xa0"birds"\xa0focusable:\xa0true[role="treeitem"]');
|
|
});
|
|
|
|
it('listen for removed nodes and redraw tree', async () => {
|
|
await enableExperiment('fullAccessibilityTree');
|
|
await goToResource('elements/accessibility-simple-page.html');
|
|
await toggleAccessibilityTree();
|
|
const {target} = getBrowserAndPages();
|
|
const link = await target.waitForSelector('aria/cats [role="link"]');
|
|
assertNotNullOrUndefined(link);
|
|
await waitForAria('link\xa0"cats"\xa0focusable:\xa0true[role="treeitem"]');
|
|
await link.evaluate(node => node.remove());
|
|
await waitForNone('link\xa0"cats"\xa0focusable:\xa0true[role="treeitem"]', undefined, undefined, 'aria');
|
|
});
|
|
});
|