mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
refactor: gather group metadata
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Copy Past', async ({ page }) => {
|
||||
test('Copy-paste', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/rundown');
|
||||
|
||||
// clear rundown
|
||||
await page.getByRole('button', { name: 'Clear rundown' }).click();
|
||||
await page.getByRole('button', { name: 'Delete all' }).click();
|
||||
|
||||
//create event
|
||||
// create event
|
||||
await page.getByRole('button', { name: 'Create Event' }).click();
|
||||
await page.getByTestId('entry-1').click();
|
||||
await page.getByLabel('Cue', { exact: true }).click();
|
||||
@@ -18,22 +18,22 @@ test('Copy Past', async ({ page }) => {
|
||||
await page.getByTestId('block__title').fill('test');
|
||||
await page.getByTestId('block__title').press('Enter');
|
||||
|
||||
//copy past below
|
||||
// copy paste below
|
||||
await page.locator('div').filter({ hasText: /^4$/ }).click();
|
||||
await page.locator('div').filter({ hasText: /^4$/ }).press('Control+c');
|
||||
await page.locator('div').filter({ hasText: /^4$/ }).press('Control+v');
|
||||
|
||||
//assert
|
||||
// assert
|
||||
await expect(page.getByTestId('entry-2')).toBeVisible();
|
||||
await expect(page.getByTestId('entry-2').getByTestId('block__title')).toHaveValue('test');
|
||||
await expect(page.getByTestId('entry-2').locator('#event-block')).toContainText('5');
|
||||
|
||||
//copy past above
|
||||
// copy paste above
|
||||
await page.locator('div').filter({ hasText: /^5$/ }).click();
|
||||
await page.locator('div').filter({ hasText: /^5$/ }).press('Control+c');
|
||||
await page.locator('div').filter({ hasText: /^5$/ }).press('Control+Shift+v');
|
||||
|
||||
//assert
|
||||
// assert
|
||||
await expect(page.getByTestId('entry-2')).toBeVisible();
|
||||
await expect(page.getByTestId('entry-2').getByTestId('block__title')).toHaveValue('test');
|
||||
await expect(page.getByTestId('entry-2').locator('#event-block')).toContainText('4.1');
|
||||
@@ -46,17 +46,17 @@ test('Move', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Clear rundown' }).click();
|
||||
await page.getByRole('button', { name: 'Delete all' }).click();
|
||||
|
||||
//create events
|
||||
// create events
|
||||
await page.getByRole('button', { name: 'Create Event' }).click();
|
||||
await page.getByRole('button', { name: 'Event' }).nth(4).click();
|
||||
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
|
||||
|
||||
//copy move down
|
||||
// copy move down
|
||||
await page.getByTestId('entry-1').locator('#event-block').getByText('1').click();
|
||||
await page.getByTestId('entry-1').locator('#event-block div').filter({ hasText: '1' }).press('Alt+Control+ArrowDown');
|
||||
await expect(page.getByTestId('entry-2').locator('#event-block')).toContainText('1');
|
||||
|
||||
//copy move up
|
||||
// copy move up
|
||||
await page.getByTestId('entry-3').locator('#event-block').getByText('3').click();
|
||||
await page.getByTestId('entry-3').locator('#event-block div').filter({ hasText: '3' }).press('Alt+Control+ArrowUp');
|
||||
await page.getByTestId('entry-2').locator('div').filter({ hasText: /^3$/ }).press('Alt+Control+ArrowUp');
|
||||
@@ -70,18 +70,25 @@ test('Add block', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Clear rundown' }).click();
|
||||
await page.getByRole('button', { name: 'Delete all' }).click();
|
||||
|
||||
//create events
|
||||
// create events
|
||||
await page.getByRole('button', { name: 'Create Event' }).click();
|
||||
await page.getByPlaceholder(/event title/i).fill('test');
|
||||
await page.getByTestId('entry-1').click();
|
||||
await page.getByTestId('block__title').press('Escape');
|
||||
|
||||
//add block below
|
||||
// add block below
|
||||
await page.getByTestId('entry-1').locator('#event-block div').filter({ hasText: '1' }).press('Alt+B');
|
||||
await expect(page.getByPlaceholder('Block title')).toBeVisible();
|
||||
await page.getByPlaceholder(/block title/i).fill('block below');
|
||||
|
||||
//add block above
|
||||
// add block above
|
||||
await page.getByTestId('entry-1').locator('#event-block div').filter({ hasText: '1' }).press('Alt+Shift+B');
|
||||
await expect(page.getByTestId('entry-0').getByTestId('block__title')).toBeVisible();
|
||||
await page
|
||||
.getByPlaceholder(/block title/i)
|
||||
.first()
|
||||
.fill('block above');
|
||||
|
||||
await expect(page.getByTestId(/block__title/i).first()).toHaveValue('block above');
|
||||
await expect(page.getByTestId(/block__title/i).nth(2)).toHaveValue('block below');
|
||||
await expect(page.getByTestId('entry-1').getByTestId(/block__title/)).toHaveValue('test');
|
||||
});
|
||||
|
||||
test('Add delay', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user