Skip to content

Commit 9ff4eef

Browse files
committedMar 3, 2025·
Add a Playwright test for the tour
1 parent 08ac431 commit 9ff4eef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { test, signIn, expect } = require("./utils.js");
2+
3+
test(`The tour runs when it should do`, async ({ page }) => {
4+
await signIn(page);
5+
6+
// the tour doesn't show normally
7+
await expect(page.locator(".introjs-tooltip")).toHaveCount(0);
8+
9+
// the tour does show when a user clicks the tour button
10+
await page.getByText("Training").click();
11+
await page.getByText("Take the tour").click();
12+
await expect(page.locator(".introjs-tooltip")).toHaveCount(1);
13+
14+
// the tour doesn't show again next time
15+
await page.reload();
16+
await expect(page.locator(".introjs-tooltip")).toHaveCount(0);
17+
18+
});

0 commit comments

Comments
 (0)
Please sign in to comment.