Skip to content

Commit

Permalink
LG-12800 a11y test skips redirect files
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfarkas committed Jul 3, 2024
1 parent 2ebab71 commit 96bbeb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/e2e/accessibility.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, before, after, test, it } from 'node:test';
import assert from 'node:assert';
import { relative, dirname } from 'node:path';
import { readFile } from 'node:fs/promises';
import glob from 'fast-glob';
import puppeteer from 'puppeteer';
import { AxePuppeteer } from '@axe-core/puppeteer';
Expand Down Expand Up @@ -42,6 +43,11 @@ describe('accessibility', () => {

paths.forEach((path) => {
test(path, async () => {
// redirects are causing testing issues
const file = await readFile(`./_site${path}index.html`, { encoding: 'utf8' });
if (file.match('<meta http-equiv="refresh"')) {
return console.log(`redirect skipped: ${path}`);
}
const page = await browser.newPage();
await page.goto(`http://localhost:${port}${path}`);
const results = await new AxePuppeteer(page)
Expand Down

0 comments on commit 96bbeb7

Please sign in to comment.