-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathgatherpress-admin-venue.spec.js
41 lines (32 loc) · 1.28 KB
/
gatherpress-admin-venue.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
const { test } = require('@playwright/test');
const { login } = require('../reusable-user-steps/common.js');
test.describe('e2e test for venue through admin side', () => {
test.beforeEach(async ({ page }) => {
test.setTimeout(120000);
await page.setViewportSize({ width: 1920, height: 720 });
await page.waitForLoadState('networkidle');
});
test('The admin should be able to create a new post for Venue', async ({
page,
}) => {
await login({ page, username: 'testuser1' });
await page.getByRole('link', { name: 'Events', exact: true }).click();
await page.getByRole('link', { name: 'Venues' }).click();
await page.screenshot({ path: 'vanue-page.png' });
await page
.locator('#wpbody-content')
.getByRole('link', { name: 'Add New' })
.click();
await page.getByLabel('Add title').isVisible();
await page.getByLabel('Add title').fill('Test venue');
await page.getByLabel('Add title').press('Tab');
const venue = await page.$('.gatherpress-venue__name');
await venue.press('Backspace');
await page
.getByLabel('Empty block; start writing or')
.fill('test venue information');
await page.getByLabel('Toggle block inserter').click();
await page.getByRole('option', { name: 'Paragraph' }).click();
await page.screenshot({ path: 'new-venue.png' });
});
});