Skip to content

Commit 5a2b60e

Browse files
authored
Merge pull request #40 from szolkowski/feature/replace-networkidle-with-domcontentloaded
Replace 'networkidle' with 'domcontentloaded' in visual tests for improved page load handling
2 parents b319777 + 89ac516 commit 5a2b60e

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/about.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test.describe('about page (/about/)', () => {
3737

3838
test('visual: full page', async ({ page }) => {
3939
await page.goto('/about/');
40-
await page.waitForLoadState('networkidle');
40+
await page.waitForLoadState('domcontentloaded');
4141
await expect(page).toHaveScreenshot(`about-${process.platform}.png`, { fullPage: true });
4242
});
4343
});

tests/archive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test.describe('archive page (/archive/)', () => {
2121

2222
test('visual: full page', async ({ page }) => {
2323
await page.goto('/archive/');
24-
await page.waitForLoadState('networkidle');
24+
await page.waitForLoadState('domcontentloaded');
2525
await expect(page).toHaveScreenshot(`archive-${process.platform}.png`, { fullPage: true });
2626
});
2727
});

tests/home.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test.describe('home page (/)', () => {
4747

4848
test('visual: full page', async ({ page }) => {
4949
await page.goto('/');
50-
await page.waitForLoadState('networkidle');
50+
await page.waitForLoadState('domcontentloaded');
5151
await expect(page).toHaveScreenshot(`home-${process.platform}.png`, { fullPage: true });
5252
});
5353
});

tests/not-found.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test.describe('404 page (/404.html)', () => {
2222

2323
test('visual: full page', async ({ page }) => {
2424
await page.goto('/404.html');
25-
await page.waitForLoadState('networkidle');
25+
await page.waitForLoadState('domcontentloaded');
2626
await expect(page).toHaveScreenshot(`not-found-${process.platform}.png`, { fullPage: true });
2727
});
2828
});

tests/post.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test.describe(`post page (${POST_PATH})`, () => {
4444

4545
test('visual: above the fold', async ({ page }) => {
4646
await page.goto(POST_PATH);
47-
await page.waitForLoadState('networkidle');
47+
await page.waitForLoadState('domcontentloaded');
4848
await expect(page).toHaveScreenshot(`post-above-fold-${process.platform}.png`, {
4949
fullPage: false,
5050
});

tests/tag-page.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test.describe(`tag page (${TAG_PATH})`, () => {
3636

3737
test('visual: above the fold', async ({ page }) => {
3838
await page.goto(TAG_PATH);
39-
await page.waitForLoadState('networkidle');
39+
await page.waitForLoadState('domcontentloaded');
4040
await expect(page).toHaveScreenshot(`tag-page-above-fold-${process.platform}.png`, {
4141
fullPage: false,
4242
});

tests/tags-index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test.describe('tags index (/tags/)', () => {
5656

5757
test('visual: full page', async ({ page }) => {
5858
await page.goto('/tags/');
59-
await page.waitForLoadState('networkidle');
59+
await page.waitForLoadState('domcontentloaded');
6060
await expect(page).toHaveScreenshot(`tags-index-${process.platform}.png`, { fullPage: true });
6161
});
6262
});

0 commit comments

Comments
 (0)