chore: re-enable a11y checks in visual suite (#7747)

* re-enable main test

* Enable tests and fix some failing ones

* revert accidental changes

* test(a11y): on failure, take a screenshot to disk

* test(visual): wait for the snapshot indicator to stop flashing

* Fix all failing tests

* test: disable a11y checks for planning suite

* lint:fix

* fix pathing issues

* build: increase visual-a11y parallelism from 2 to 4

* test: darkmatter theme a11y checks + snapshots-- ACTIVATE!

* test: fix file name and path

* fix(#7317): scott bell prophecy

* jk no credit for u

* chore: disable parallelism until we figure out what's going on

* chore: set parallelism to 2 in hopes it fixes percy

---------

Co-authored-by: Hill, John (ARC-TI)[KBR Wyle Services, LLC] <john.c.hill@nasa.gov>
Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
This commit is contained in:
Rukmini Bose (Ruki)
2024-06-18 18:16:54 -07:00
committed by GitHub
parent 34b4091204
commit a5770817cc
17 changed files with 958 additions and 816 deletions

View File

@ -27,7 +27,7 @@ Tests the branding associated with the default deployment. At least the about mo
import percySnapshot from '@percy/playwright';
import { fileURLToPath } from 'url';
import { expect, test } from '../../../avpFixtures.js';
import { expect, scanForA11yViolations, test } from '../../../avpFixtures.js';
import { VISUAL_FIXED_URL } from '../../../constants.js';
//Declare the component scope of the visual test for Percy
@ -69,14 +69,26 @@ test.describe('Visual - Header @a11y', () => {
});
test('show snapshot button', async ({ page, theme }) => {
test.slow(true, 'We have to wait for the snapshot indicator to stop flashing');
await page.getByLabel('Open the Notebook Snapshot Menu').click();
await page.getByRole('menuitem', { name: 'Save to Notebook Snapshots' }).click();
await expect(page.getByLabel('Show Snapshots')).toBeVisible();
/**
* We have to wait for the snapshot indicator to stop flashing. This happens
* for a really long time (15 seconds 😳).
* TODO: Either reduce the length of the animation, convert this to a
* Playwright snapshot test (and disable animations), or augment the `waitForAnimations`
* fixture to adjust the timeout.
*/
await expect(page.locator('.has-new-snapshot')).not.toBeAttached({
timeout: 30 * 1000
});
await percySnapshot(page, `Notebook Snapshot Show button (theme: '${theme}')`, {
scope: header
});
await expect(page.getByLabel('Show Snapshots')).toBeVisible();
});
});
@ -99,7 +111,6 @@ test.describe('Mission Header @a11y', () => {
});
});
});
// Skipping for https://github.com/nasa/openmct/issues/7421
// test.afterEach(async ({ page }, testInfo) => {
// await scanForA11yViolations(page, testInfo.title);
// });
test.afterEach(async ({ page }, testInfo) => {
await scanForA11yViolations(page, testInfo.title);
});