Skip to content

Commit de356ff

Browse files
committed
visit each page once
1 parent c696ff1 commit de356ff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

e2e/script.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ async function checkPath(page, path) {
2929

3030
// Check if the button exists, is visible, and is enabled
3131
async 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
6766
async 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 = [
133131
async 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

Comments
 (0)