From 23941bbf4e405e95e11714eb10c8b0be582af7a1 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Tue, 17 Oct 2023 14:45:56 +0100 Subject: [PATCH] Run each accessibility test in a new page --- __tests__/accessibility-audit.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/__tests__/accessibility-audit.test.js b/__tests__/accessibility-audit.test.js index e57a90f4d1..91538f0499 100644 --- a/__tests__/accessibility-audit.test.js +++ b/__tests__/accessibility-audit.test.js @@ -68,8 +68,12 @@ describe('Accessibility audit', () => { it.each(globSync('**/index.html', { cwd: paths.public }))( 'validates %s', async (path) => { + const page = await browser.newPage() + await goTo(page, `/${slash(path)}`) await expect(axe(page)).resolves.toHaveNoViolations() + + await page.close() }, 10000 )