-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
settings.spec.js
41 lines (32 loc) · 1.2 KB
/
settings.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// @ts-check
const {test, expect} = require("../fixtures");
test("Open settings", async ({page, ui}) => {
await ui.gotoLoggedInCore();
// open settings dialog
await page.getByTestId("settings-open").click();
// verify it's open
await expect(page.getByTestId("settings-dialog")).toBeVisible();
});
test.describe.parallel("Close settings", () => {
test.beforeEach(async ({page, ui}) => {
await ui.gotoLoggedInCore();
await page.getByTestId("settings-open").click();
await expect(page.getByTestId("settings-dialog")).toBeVisible();
});
test("via button", async ({page}) => {
await page.getByTestId("settings-close-button").click();
});
test("via x", async ({page}) => {
await page.getByTestId("settings-close-x").click();
});
test("via ESC", async ({page}) => {
await page.getByTestId("settings-dialog").press("Escape");
});
test("via click outside", async ({page}) => {
await page.locator(".modal-scrollable").click({position: {x: 10, y: 10}});
});
test.afterEach(async ({page}) => {
// verify it's closed
await expect(page.getByTestId("settings-dialog")).not.toBeVisible();
});
});