Skip to content

Commit 177a78a

Browse files
committed
Updates to wait until DOMContentLoaded, moves Axe scan
1 parent 14a7ae9 commit 177a78a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/actions/find/src/findForUrl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ export async function findForUrl(
2525
const context = await browser.newContext(contextOptions);
2626
const page = await context.newPage();
2727
await page.goto(url);
28+
await page.waitForLoadState("domcontentloaded");
2829
console.log(`Scanning ${page.url()}`);
2930

3031
let findings: Finding[] = [];
3132
try {
32-
const rawFindings = await new AxeBuilder({ page }).analyze();
33-
3433
let screenshotId: string | undefined;
3534

3635
if (includeScreenshots) {
@@ -58,6 +57,7 @@ export async function findForUrl(
5857
}
5958
}
6059

60+
const rawFindings = await new AxeBuilder({ page }).analyze();
6161
findings = rawFindings.violations.map((violation) => ({
6262
scannerType: "axe",
6363
url,
@@ -72,7 +72,7 @@ export async function findForUrl(
7272
screenshotId,
7373
}));
7474
} catch (e) {
75-
// do something with the error
75+
console.error("Error during accessibility scan:", e);
7676
}
7777
await context.close();
7878
await browser.close();

0 commit comments

Comments
 (0)