-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathschedule.test.ts
More file actions
63 lines (48 loc) · 2.31 KB
/
schedule.test.ts
File metadata and controls
63 lines (48 loc) · 2.31 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { test, expect } from '@playwright/test'
import { login } from './generic'
test('Create-Edit-Delete-Schedule-Event', async ({ page }) => {
await login(page)
// Navigate to schedule page
await page.goto(`${process.env.LINK}/schedule`)
await page.waitForTimeout(1000)
// Click a date cell in FullCalendar to open create modal
await page.locator('.fc-daygrid-day').nth(15).click()
await page.waitForTimeout(300)
// Fill in event form
await page.getByLabel('Title').fill('Event at 15th')
await page.getByLabel('Description').fill('This is a test event at 15th')
// Fill end date (second datetime-local input)
const dateInputs = page.locator('input[type="datetime-local"]')
await dateInputs.nth(1).fill('2026-08-18T00:01')
// Test invalid meeting link
// await page.getByLabel('Meeting Link').fill('hshshsh')
// await page.locator('#Submit').click()
// await expect(page.getByText('Failed to create event')).toBeVisible()
// await expect(page.getByText('Successfully created event')).not.toBeVisible()
// Fix meeting link and submit
await page.getByLabel('Meeting Link').fill('https://example.com')
await page.locator('#Submit').click()
await expect(page.getByText('Failed to create event')).not.toBeVisible()
await expect(page.getByText('Successfully created event')).toBeVisible()
// Wait for calendar to update
await page.waitForTimeout(1000)
// Click the created event to open edit modal
await page.locator('.fc-event', { hasText: 'Event at 15th' }).first().click()
await page.waitForTimeout(300)
// Edit the event title
await page.getByLabel('Title').fill('newly edited title')
// Change end date
const editDateInputs = page.locator('input[type="datetime-local"]')
await editDateInputs.nth(1).fill('2027-08-16T00:01')
// Submit the edit
await page.locator('#Submit').click()
await expect(page.getByText('Failed to create event')).not.toBeVisible()
await expect(page.getByText('Successfully edited event')).toBeVisible()
// Wait for calendar to update
await page.waitForTimeout(1000)
// Click the edited event and delete it
await page.locator('.fc-event', { hasText: 'newly edited title' }).first().click()
await page.waitForTimeout(300)
await page.locator('#Delete').click()
await expect(page.getByText('Successfully deleted event')).toBeVisible()
})