Skip to content

Commit bd26195

Browse files
dbaronDevtools-frontend LUCI CQ
authored andcommitted
Add e2e tests for accessibility issues on interactive content in <summary>.
Bug: 427172874 Change-Id: Icc5e5cfb8a503e32fc1d9282ce02e163d2642790 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6667583 Commit-Queue: Simon Zünd <[email protected]> Reviewed-by: Changhao Han <[email protected]> Reviewed-by: Simon Zünd <[email protected]> Auto-Submit: David Baron <[email protected]>
1 parent e0ba4d8 commit bd26195

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

test/e2e/host/user-metrics_test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,19 @@ describe('User Metrics for Issue Panel', () => {
594594
},
595595
]);
596596
});
597+
598+
it('dispatches an event when a ElementAccessibility InteractiveContentSummaryDescendant issue is created',
599+
async () => {
600+
await goToResource('issues/summary-element-accessibility-issue-InteractiveContentSummaryDescendant.html');
601+
await waitFor('.issue');
602+
603+
await assertHistogramEventsInclude([
604+
{
605+
actionName: 'DevTools.IssueCreated',
606+
actionCode: 113, // ElementAccessibilityIssue::InteractiveContentSummaryDescendant
607+
},
608+
]);
609+
});
597610
});
598611

599612
describe('User Metrics for CSS custom properties in the Styles pane', () => {

test/e2e/issues/select-element-accessibility-issues_test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,18 @@ describe('Select element accessibility issues test', () => {
9797
];
9898
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
9999
});
100+
101+
it('should display issue when there is an interactive element as a descendant of a summary element', async () => {
102+
await goToResource('issues/summary-element-accessibility-issue-InteractiveContentSummaryDescendant.html');
103+
await navigateToIssuesTab();
104+
const issueElement = await getAndExpandSpecificIssueByTitle('Interactive element inside of a <summary> element');
105+
assertNotNullOrUndefined(issueElement);
106+
107+
const section = await getResourcesElement('1 element', issueElement);
108+
await ensureResourceSectionIsExpanded(section);
109+
const expectedTableRows = [
110+
['Disallowed descendant'],
111+
];
112+
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
113+
});
100114
});

test/e2e/resources/issues/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ copy_to_gen("issues") {
2626
"select-element-accessibility-issue-InteractiveContentLegendChild.html",
2727
"select-element-accessibility-issue-InteractiveContentOptionChild.html",
2828
"select-element-accessibility-issue-NonPhrasingContentOptionChild.html",
29+
"summary-element-accessibility-issue-InteractiveContentSummaryDescendant.html",
2930
"wasm-co-iframe.html",
3031
"wasm-co-sharing.html",
3132
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!DOCTYPE html>
2+
3+
<details>
4+
<summary>This is <a href="https://example.com/">a link</a> in a summary.</summary>
5+
6+
<p>More details.</p>
7+
</details>

0 commit comments

Comments
 (0)