Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

test(a11y): the coverage checks of 17 binding specs run as one serial part per state (#9071)

Cindy Zhang9e07422c7633
diff --git a/packages/core/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts b/packages/core/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts
index 7f6c000168..71b6ea1df8 100644
--- a/packages/core/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts
+++ b/packages/core/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts
@@ -91,15 +91,27 @@ async function runState(
});
}
-test('every alert-dialog expectation is exercised by an AlertDialog state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every alert-dialog expectation is exercised by an AlertDialog state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of ALERT_DIALOG_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ ALERT_DIALOG_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of ALERT_DIALOG_BINDING_STATES) {
diff --git a/packages/core/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts b/packages/core/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts
index 4b6daf679e..7d4be325f8 100644
--- a/packages/core/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts
+++ b/packages/core/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts
@@ -97,15 +97,27 @@ async function runState(
});
}
-test('every Breadcrumb expectation is exercised by at least one state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every Breadcrumb expectation is exercised by at least one state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of BREADCRUMB_A11Y_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ BREADCRUMB_A11Y_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of BREADCRUMB_A11Y_STATES) {
diff --git a/packages/core/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts b/packages/core/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts
index bc69c70269..22362217d8 100644
--- a/packages/core/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts
+++ b/packages/core/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts
@@ -101,16 +101,30 @@ async function runState(
});
}
-test('every grid expectation is exercised by a Calendar state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every grid expectation is exercised by a Calendar state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of CALENDAR_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(unmatchedKnownFailures(CALENDAR_KNOWN_FAILURES, results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ CALENDAR_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(unmatchedKnownFailures(CALENDAR_KNOWN_FAILURES, results)).toEqual(
+ [],
+ );
+ });
});
for (const state of CALENDAR_BINDING_STATES) {
diff --git a/packages/core/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts b/packages/core/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts
index 5e3bc9f0d2..56bc8de74c 100644
--- a/packages/core/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts
+++ b/packages/core/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts
@@ -120,16 +120,30 @@ function bindingState(id: string): CarouselBindingRow {
return state;
}
-test('every expectation is exercised by at least one Carousel state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every expectation is exercised by at least one Carousel state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of CAROUSEL_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(unmatchedKnownFailures(CAROUSEL_KNOWN_FAILURES, results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ CAROUSEL_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(unmatchedKnownFailures(CAROUSEL_KNOWN_FAILURES, results)).toEqual(
+ [],
+ );
+ });
});
for (const state of CAROUSEL_BINDING_STATES) {
diff --git a/packages/core/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts b/packages/core/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts
index 7470291664..c5a387e52b 100644
--- a/packages/core/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts
+++ b/packages/core/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts
@@ -155,16 +155,27 @@ test('the state inventory matches rendered disclosure facts', async ({
expect(wrong).toEqual([]);
});
-test('every disclosure expectation is exercised by a Collapsible state', async ({
- page,
-}) => {
- test.setTimeout(3 * 60 * 1000);
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every disclosure expectation is exercised by a Collapsible state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of COLLAPSIBLE_DISCLOSURE_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ COLLAPSIBLE_DISCLOSURE_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of COLLAPSIBLE_DISCLOSURE_STATES) {
diff --git a/packages/core/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts b/packages/core/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts
index d9b70c4928..fe1849c9e3 100644
--- a/packages/core/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts
+++ b/packages/core/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts
@@ -103,15 +103,27 @@ async function runState(
});
}
-test('every accordion expectation is exercised by a CollapsibleGroup state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every accordion expectation is exercised by a CollapsibleGroup state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ COLLAPSIBLE_GROUP_ACCORDION_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
diff --git a/packages/core/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts b/packages/core/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts
index 3e348361e2..1a3514b2ac 100644
--- a/packages/core/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts
+++ b/packages/core/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts
@@ -120,16 +120,28 @@ async function runState(
});
}
-test('every menu expectation is exercised by a DropdownMenu state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every menu expectation is exercised by a DropdownMenu state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of MENU_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(unmatchedKnownFailures(MENU_KNOWN_FAILURES, results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ MENU_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(unmatchedKnownFailures(MENU_KNOWN_FAILURES, results)).toEqual([]);
+ });
});
for (const state of MENU_BINDING_STATES) {
diff --git a/packages/core/src/Layout/__tests__/Layout.a11y.chromium.spec.ts b/packages/core/src/Layout/__tests__/Layout.a11y.chromium.spec.ts
index c7b0d1ba55..fd07e073f9 100644
--- a/packages/core/src/Layout/__tests__/Layout.a11y.chromium.spec.ts
+++ b/packages/core/src/Layout/__tests__/Layout.a11y.chromium.spec.ts
@@ -93,15 +93,27 @@ async function runState(
});
}
-test('every Landmark expectation is exercised by at least one Layout state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every Landmark expectation is exercised by at least one Layout state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of LAYOUT_LANDMARK_A11Y_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ LAYOUT_LANDMARK_A11Y_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of LAYOUT_LANDMARK_A11Y_STATES) {
diff --git a/packages/core/src/Link/__tests__/Link.a11y.chromium.spec.ts b/packages/core/src/Link/__tests__/Link.a11y.chromium.spec.ts
index 87555a77f3..b89a90e202 100644
--- a/packages/core/src/Link/__tests__/Link.a11y.chromium.spec.ts
+++ b/packages/core/src/Link/__tests__/Link.a11y.chromium.spec.ts
@@ -113,17 +113,27 @@ async function runState(
});
}
-test('every Link expectation is exercised by at least one Link state', async ({
- page,
-}) => {
- // Mounts every state in one test, so it gets every state's time budget.
- test.setTimeout(30_000 * LINK_A11Y_STATES.length);
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every Link expectation is exercised by at least one Link state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of LINK_A11Y_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ LINK_A11Y_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of LINK_A11Y_STATES) {
diff --git a/packages/core/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts b/packages/core/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts
index 55452b0aae..b4616631a2 100644
--- a/packages/core/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts
+++ b/packages/core/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts
@@ -87,18 +87,30 @@ async function runState(
});
}
-test('every progressbar expectation is exercised by a ProgressBar state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every progressbar expectation is exercised by a ProgressBar state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of PROGRESSBAR_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(unmatchedKnownFailures(PROGRESSBAR_KNOWN_FAILURES, results)).toEqual(
- [],
- );
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ PROGRESSBAR_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(unmatchedKnownFailures(PROGRESSBAR_KNOWN_FAILURES, results)).toEqual(
+ [],
+ );
+ });
});
for (const state of PROGRESSBAR_BINDING_STATES) {
diff --git a/packages/core/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts b/packages/core/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts
index 553aed2568..79d2de5b42 100644
--- a/packages/core/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts
+++ b/packages/core/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts
@@ -87,23 +87,30 @@ async function runState(
});
}
-test('every window-splitter expectation is exercised by a ResizeHandle state', async ({
- page,
-}) => {
- // One test mounts and checks every binding state in turn: about 20s on an
- // idle machine, three times that when the contract run shares a runner's
- // cores, so the default 60s ran out mid-loop on whichever state it reached.
- // Budget it like the other whole-inventory sweeps (Button, Checkbox).
- test.setTimeout(3 * 60 * 1000);
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every window-splitter expectation is exercised by a ResizeHandle state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of RESIZE_HANDLE_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(unmatchedKnownFailures(RESIZE_HANDLE_KNOWN_FAILURES, results)).toEqual(
- [],
- );
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ RESIZE_HANDLE_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(
+ unmatchedKnownFailures(RESIZE_HANDLE_KNOWN_FAILURES, results),
+ ).toEqual([]);
+ });
});
for (const state of RESIZE_HANDLE_BINDING_STATES) {
diff --git a/packages/core/src/Slider/__tests__/Slider.a11y.chromium.spec.ts b/packages/core/src/Slider/__tests__/Slider.a11y.chromium.spec.ts
index ff6b804830..89849e9360 100644
--- a/packages/core/src/Slider/__tests__/Slider.a11y.chromium.spec.ts
+++ b/packages/core/src/Slider/__tests__/Slider.a11y.chromium.spec.ts
@@ -87,16 +87,28 @@ async function runState(
});
}
-test('every slider expectation is exercised by a Slider state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every slider expectation is exercised by a Slider state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of SLIDER_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(unmatchedKnownFailures(SLIDER_KNOWN_FAILURES, results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ SLIDER_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(unmatchedKnownFailures(SLIDER_KNOWN_FAILURES, results)).toEqual([]);
+ });
});
for (const state of SLIDER_BINDING_STATES) {
diff --git a/packages/core/src/Table/__tests__/Table.a11y.chromium.spec.ts b/packages/core/src/Table/__tests__/Table.a11y.chromium.spec.ts
index f2c6adf146..6e06821c18 100644
--- a/packages/core/src/Table/__tests__/Table.a11y.chromium.spec.ts
+++ b/packages/core/src/Table/__tests__/Table.a11y.chromium.spec.ts
@@ -100,15 +100,27 @@ async function runState(
});
}
-test('every Table expectation is exercised by at least one Table state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every Table expectation is exercised by at least one Table state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of TABLE_A11Y_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ TABLE_A11Y_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of TABLE_A11Y_STATES) {
diff --git a/packages/core/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts b/packages/core/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts
index e841fa7b76..a18134df00 100644
--- a/packages/core/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts
+++ b/packages/core/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts
@@ -93,15 +93,27 @@ async function runState(
});
}
-test('every toolbar expectation is exercised by a Toolbar state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every toolbar expectation is exercised by a Toolbar state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of TOOLBAR_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ TOOLBAR_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
/**
diff --git a/packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts b/packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts
index 0619e4895c..f5e5639bd4 100644
--- a/packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts
+++ b/packages/core/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts
@@ -104,16 +104,27 @@ async function runState(
});
}
-test('every tooltip expectation is exercised by a Tooltip state', async ({
- page,
-}) => {
- test.setTimeout(3 * 60 * 1000);
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every tooltip expectation is exercised by a Tooltip state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of TOOLTIP_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ TOOLTIP_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ });
});
for (const state of TOOLTIP_BINDING_STATES) {
diff --git a/packages/lab/src/Chat/__tests__/ChatTypingIndicator.a11y.chromium.spec.ts b/packages/lab/src/Chat/__tests__/ChatTypingIndicator.a11y.chromium.spec.ts
index 5108d6baf2..688e977565 100644
--- a/packages/lab/src/Chat/__tests__/ChatTypingIndicator.a11y.chromium.spec.ts
+++ b/packages/lab/src/Chat/__tests__/ChatTypingIndicator.a11y.chromium.spec.ts
@@ -140,17 +140,29 @@ async function runState(
});
}
-test('the exact known failure matches one executed ChatTypingIndicator result', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('the exact known failure matches one executed ChatTypingIndicator result', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of CHAT_TYPING_STATUS_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(
- unmatchedKnownFailures(CHAT_TYPING_STATUS_KNOWN_FAILURES, results),
- ).toEqual([]);
+
+ test('the exact known failure matches one executed result', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ CHAT_TYPING_STATUS_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(
+ unmatchedKnownFailures(CHAT_TYPING_STATUS_KNOWN_FAILURES, results),
+ ).toEqual([]);
+ });
});
for (const state of CHAT_TYPING_STATUS_BINDING_STATES) {
diff --git a/packages/lab/src/CircularProgress/__tests__/CircularProgress.a11y.chromium.spec.ts b/packages/lab/src/CircularProgress/__tests__/CircularProgress.a11y.chromium.spec.ts
index ee48b38c0e..745cf5d359 100644
--- a/packages/lab/src/CircularProgress/__tests__/CircularProgress.a11y.chromium.spec.ts
+++ b/packages/lab/src/CircularProgress/__tests__/CircularProgress.a11y.chromium.spec.ts
@@ -87,18 +87,30 @@ async function runState(
});
}
-test('every progressbar expectation is exercised by a CircularProgress state', async ({
- page,
-}) => {
- const cdp = await page.context().newCDPSession(page);
+// Checking coverage runs every state again, which on a loaded runner nears
+// the per-test timeout as one test. It runs as one serial part per state,
+// sharing their results, then one check over all of them.
+test.describe('every progressbar expectation is exercised by a CircularProgress state', () => {
+ test.describe.configure({mode: 'serial'});
const results: BindingResult[] = [];
+
for (const state of CIRCULAR_PROGRESS_BINDING_STATES) {
- results.push(await runState(page, cdp, state));
+ test(`runs ${state.id}`, async ({page}) => {
+ const cdp = await page.context().newCDPSession(page);
+ results.push(await runState(page, cdp, state));
+ });
}
- expect(neverExercised(results)).toEqual([]);
- expect(
- unmatchedKnownFailures(CIRCULAR_PROGRESS_KNOWN_FAILURES, results),
- ).toEqual([]);
+
+ test('no expectation is left unexercised', () => {
+ // Every part ran in this worker; this test alone proves nothing.
+ expect(results.map(result => result.state).sort()).toEqual(
+ CIRCULAR_PROGRESS_BINDING_STATES.map(state => state.id).sort(),
+ );
+ expect(neverExercised(results)).toEqual([]);
+ expect(
+ unmatchedKnownFailures(CIRCULAR_PROGRESS_KNOWN_FAILURES, results),
+ ).toEqual([]);
+ });
});
for (const state of CIRCULAR_PROGRESS_BINDING_STATES) {