File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments