forked from lukevella/rallly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobile-test.spec.ts
32 lines (26 loc) · 1.21 KB
/
mobile-test.spec.ts
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
import { expect, test } from "@playwright/test";
test("should be able to vote and comment on a poll", async ({ page }) => {
await page.setViewportSize({ width: 375, height: 667 });
await page.goto("/demo");
await expect(page.locator('text="Lunch Meeting"')).toBeVisible();
await page.click("text='New'");
await page.click("data-testid=poll-option >> nth=0");
await page.click("data-testid=poll-option >> nth=1");
await page.click("data-testid=poll-option >> nth=3");
await page.type('[placeholder="Your name…"]', "Test user");
await page.click("text=Save");
await expect(page.locator("text='Test user'")).toBeVisible();
await expect(page.locator("data-testid=user")).toBeVisible();
await expect(
page.locator("data-testid=participant-selector").locator("text=You"),
).toBeVisible();
await page.click("text=Edit");
await page.click("data-testid=poll-option >> nth=1");
await page.click("text=Save");
await expect(page.locator("data-testid=poll-option >> nth=1 ")).toContainText(
"2",
);
await page.click("data-testid=delete-participant-button");
await page.locator("button", { hasText: "Delete" }).click();
await expect(page.locator("text='Test user'")).not.toBeVisible();
});