-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththread.ts
More file actions
22 lines (19 loc) · 832 Bytes
/
thread.ts
File metadata and controls
22 lines (19 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { expect } from '@playwright/test';
export async function createThread(
page: any,
group = { name: 'Test Group', public: false },
thread = { title: 'Test Thread', description: 'Test Description' }
) {
await page.getByRole('button', { name: 'Create a post' }).click();
await page.waitForTimeout(500);
await page.getByRole('button', { name: 'Thread' }).click();
await page.getByLabel('Title').click();
await page.getByLabel('Title').fill('Test Thread');
await page.getByLabel('Description').click();
await page.getByLabel('Description').fill('Test Description');
await page.getByRole('button', { name: 'Post' }).click();
await expect(page.getByRole('heading', { name: 'Thread' })).toBeVisible();
await expect(
page.locator('#poll-timeline').filter({ hasText: 'Phase 1. Area voting' })
).not.toBeVisible();
}