Skip to content

Commit 3f4bf5c

Browse files
test(e2e): resolve flaky tour tests
1 parent 61d8b93 commit 3f4bf5c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

playwright/e2e/element-examples/si-tour.spec.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,27 @@ test.describe('si-tour', () => {
1111
const nextClick = (): Promise<any> =>
1212
page.locator('si-tour button', { hasText: 'Next' }).click();
1313

14+
const waitForTourStep = async (): Promise<void> => {
15+
await expect(page.locator('.tour-content.show')).toBeVisible();
16+
await expect(page.locator('.popover-arrow')).toBeVisible();
17+
};
18+
1419
await si.visitExample(example);
15-
await expect(page.locator('.tour-content')).toBeVisible();
20+
await waitForTourStep();
1621
await si.runVisualAndA11yTests('first-step');
1722

1823
await nextClick();
19-
await expect(page.locator('.tour-content')).toBeVisible();
24+
await waitForTourStep();
2025
await si.runVisualAndA11yTests('second-step');
2126

2227
await nextClick();
2328
await nextClick();
2429
await nextClick();
2530
await nextClick();
26-
await expect(page.locator('.tour-content')).toBeVisible();
31+
await waitForTourStep();
2732
await si.runVisualAndA11yTests('open-menu');
2833
await nextClick();
29-
await expect(page.locator('.tour-content')).toBeVisible();
34+
await waitForTourStep();
3035
await si.runVisualAndA11yTests('last-step');
3136
});
3237
});

0 commit comments

Comments
 (0)