Skip to content

Commit a5c8b2a

Browse files
committed
Tests: Make test less flaky
1 parent def53e0 commit a5c8b2a

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

tests/src/cards.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test.describe('Testing for cards shortcode', () => {
55
test.beforeEach(async ({ page }) => {
66
const cardsUrl = 'test-product/cards/permitted';
77
await page.goto(`/${cardsUrl}`);
8+
await page.waitForLoadState('load');
89
await waitFor(async () => await handleConsentPopup(page));
910
});
1011

tests/src/footer.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { handleConsentPopup, waitFor } from './util';
44
test.describe('Smoke test for footer', () => {
55
test.beforeEach(async ({ page }) => {
66
await page.goto('/test-product');
7+
await page.waitForLoadState('load');
78
await waitFor(async () => await handleConsentPopup(page));
89
});
910

tests/src/header.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { handleConsentPopup, waitFor } from './util';
44
test.describe('Smoke test for header', () => {
55
test.beforeEach(async ({ page }) => {
66
await page.goto('/test-product');
7+
await page.waitForLoadState('load');
78
await waitFor(async () => await handleConsentPopup(page));
89
});
910

tests/src/product-landing.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test.describe('Smoke test for landing page', () => {
77

88
for (const product of products) {
99
await page.goto(`/${product}/`);
10+
await page.waitForLoadState('load');
1011
await runSmokeTestOnPage(page);
1112
}
1213
});

tests/src/sidebar.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ test.describe('Smoke test for sidebar', () => {
4545

4646
test.beforeEach(async ({ page }) => {
4747
await page.goto('/test-product/');
48+
await page.waitForLoadState('load');
4849
});
4950

5051
test('sidebar renders', async ({ page }) => {

tests/src/tabs.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test.describe('Testing for tabs shortcode', () => {
55
test.beforeEach(async ({ page }) => {
66
const tabsUrl = 'test-product/tab-group/tab-group/';
77
await page.goto(`/${tabsUrl}`);
8+
await page.waitForLoadState('load');
89
await waitFor(async () => await handleConsentPopup(page));
910
});
1011

0 commit comments

Comments
 (0)