Files
ontime/e2e/tests/features/204-editor-crud.spec.ts
Carlos Valente 1849b4d39f Deps migration (#1988)
* chore: migrate eslint to oxlint

* chore: migrate prettier to oxfmt

* chore: migrate typescript

* chore: toThrow should have a expected value

* chore: cast test value as Day

* chore: small title fix

* chore: mocks should be hoisted

* chore: incorrect async useage

* chore: test should be inside description

* chore: test sohuld include an expeced

* chore: oxfmt

---------

Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
2026-03-08 16:22:12 +01:00

44 lines
2.3 KiB
TypeScript

import { expect, test } from '@playwright/test';
test('CRUD operations on the rundown', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Rundown menu' }).click();
await page.getByRole('menuitem', { name: 'Clear all' }).click();
await page.getByRole('button', { name: 'Delete all' }).click();
await expect(page.getByTestId('rundown-event')).toHaveCount(0);
await expect(page.getByTestId('rundown-delay')).toHaveCount(0);
await expect(page.getByTestId('rundown-group')).toHaveCount(0);
// create event from the rundown empty button
await page.getByRole('button', { name: 'Create Event' }).click();
await expect(page.getByTestId('rundown-event')).toHaveCount(1);
await expect(page.getByTestId('rundown-delay')).toHaveCount(0);
await expect(page.getByTestId('rundown-group')).toHaveCount(0);
// create groups using the quick add buttons
await page.getByTestId('rundown').getByRole('button', { name: 'Group' }).nth(1).click();
await page.getByRole('button', { name: 'Delay' }).nth(1).click();
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await expect(page.getByTestId('rundown-event')).toHaveCount(2);
await expect(page.getByTestId('rundown-delay')).toHaveCount(1);
await expect(page.getByTestId('rundown-group')).toHaveCount(1);
// test quick add options - star2+5-t is last end
await page.getByTestId('entry-2').getByTestId('time-input-duration').fill('20m');
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await expect(page.getByTestId('entry-3').getByTestId('time-input-timeStart')).toHaveValue('00:30:00');
await expect(page.getByTestId('rundown-event')).toHaveCount(3);
await expect(page.getByTestId('rundown-delay')).toHaveCount(1);
await expect(page.getByTestId('rundown-group')).toHaveCount(1);
// test quick add options
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await expect(page.getByTestId('rundown-event')).toHaveCount(4);
await expect(page.getByTestId('rundown-delay')).toHaveCount(1);
await expect(page.getByTestId('rundown-group')).toHaveCount(1);
await expect(page.getByTestId('entry-4').locator('#entry-status')).toHaveAttribute('data-timerType', 'count-down');
});