@@ -29,7 +29,6 @@ async function checkPath(page, path) {
2929
3030// Check if the button exists, is visible, and is enabled
3131async function checkButton ( page , path , buttonText ) {
32- await page . goto ( `${ BASE_URL } ${ path } ` , { waitUntil : "networkidle" } ) ;
3332 const buttons = await page . $$ ( "button" ) ;
3433 let btn = null ;
3534 for ( const b of buttons ) {
@@ -65,7 +64,6 @@ async function checkButton(page, path, buttonText) {
6564
6665// Check if the link exists, is visible, and has a valid href
6766async function checkLink ( page , path , linkText ) {
68- await page . goto ( `${ BASE_URL } ${ path } ` , { waitUntil : "networkidle" } ) ;
6967 const links = await page . $$ ( "a" ) ;
7068 let link = null ;
7169 for ( const l of links ) {
@@ -133,6 +131,7 @@ const PAGES = [
133131async function runChecks ( page ) {
134132 for ( const { path, buttons = [ ] , links = [ ] } of PAGES ) {
135133 await checkPath ( page , path ) ;
134+ await page . goto ( `${ BASE_URL } ${ path } ` , { waitUntil : "networkidle" } ) ;
136135 for ( const btn of buttons ) {
137136 await checkButton ( page , path , btn ) ;
138137 }
0 commit comments