* refactor: cleanup routes

* style: smaller base font

* chore: upgrade dependencies

* chore: lock node version to electron

* refactor: pass HTTP to integration controller (#652)

* refactor: deprecate onair control

* refactor: remove playback router

* Several project files user folder (#617)

* chore: automated screenshots (#667)

* feat: app settings (#658)

* refactor: remove deprecated event data (#674)

* Studio clock (#663)

---------

Co-authored-by: Carlos Valente <carlosvalente@pm.me>

* Feat: reorder events with alt+ctrl + arrow up/down (#645)

* Warning and danger per event (#677)

---------

Co-authored-by: Fabian Posenau <fabian@fphome.de>

* refactor: stabilise actionHandler (#683)

Co-authored-by: Fabian Posenau <fabian@fphome.de>

* improvement: hide seconds (#675)

* wip: overview (#688)

* fix: focus cursor (#695)

* refactor: update lower third (#665)

* Refactor/time formatting (#696)

---------

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
Co-authored-by: Carlos Valente <carlosvalente@pm.me>

* feat: multiple selection (#703)

---------

Co-authored-by: asharonbaltazar <asharonbaltazar@outlook.com>
Co-authored-by: Alex <ac@omnivox.dk>

* fix: test - go to `Edit mode` befor tying to click `Event options` button (#708)

* refactor: runtime service (#715)

* fix: issue with loosing cursor position on message (#719)

* remove info panel (#721)

* Event editor continue (#722)

* update API - part  (#709)

---------

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
Co-authored-by: Carlos Valente <carlosvalente@pm.me>

* refactor: update timers (#729)

* feat: many timers (#706)

---------

Co-authored-by: arc-alex <ac@omnivox.dk>

* refactor: excel cleanup (#734)

* refactor: allow import of blocks and skip import (#735)

* Project manager (#697)

* refactor: UI for linking events (#763)

* upgraded pipeline actions (#777)

* Over under (#771)

* custom fields (#744)


---------

Co-authored-by: Carlos Valente <carlosvalente@pm.me>

* Sheets settings (#774)

---------

Co-authored-by: arc-alex <ac@omnivox.dk>

* style: tweaks to lower thirds (#785)

* refactor: delays account for gaps (#784)

* refactor: partial state updates (#780)

* feat: generate crash report (#787)

* Sheet use limited input device auth flow (#782)

---------

Co-authored-by: cv <34649812+cpvalente@users.noreply.github.com>
Co-authored-by: Carlos Valente <carlosvalente@pm.me>

* Custom fields views (#789)

* refactor: deprecate presenter and subtitle (#795)

* refactor: organise API around resources (#798)

---------

Co-authored-by: Bianca Procopio <biancahprocopio@gmail.com>

* Time to end (#804)

* Skip fixes (#805)

* fix: onair derives from playback

* Param nav (#822)

---------

Co-authored-by: Alex Christoffer Rasmussen <ac@omnivox.dk>

* refactor: download files from interface (#831)

* Quick options (#814)

* End pause (#832)

* chore: bump node version in docker (#834)

* refactor: follow in run mode (#840)

* fix: uncaught error in http integration (#837)

* Apply project (#843)

Co-authored-by: Matteo Gheza <matteo.gheza07@gmail.com>
Co-authored-by: Ary <arylmoraesn@gmail.com>
Co-authored-by: Alex Christoffer Rasmussen <ac@omnivox.dk>
Co-authored-by: Fabian Posenau <19673098+kellhogs@users.noreply.github.com>
Co-authored-by: Fabian Posenau <fabian@fphome.de>
Co-authored-by: Alex Rohleder <alexrohleder96@gmail.com>
Co-authored-by: asharonbaltazar <asharonbaltazar@outlook.com>
Co-authored-by: Bianca Procopio <biancahprocopio@gmail.com>
Co-authored-by: Fabian Posenau <fabianpos99+github@gmail.com>
This commit is contained in:
Carlos Valente
2024-04-13 10:06:46 +02:00
committed by GitHub
parent debdbd1c5a
commit 55d1aca9b6
640 changed files with 26702 additions and 21623 deletions
-42
View File
@@ -1,42 +0,0 @@
import { expect, test } from '@playwright/test';
test.describe('pages routes are available', () => {
test.use({ viewport: { width: 1920, height: 1080 } });
test.describe('backstage views', () => {
test('editor', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await expect(page).toHaveTitle(/ontime/);
await expect(page.getByTestId('event-editor')).toBeVisible()
await expect(page.getByTestId('panel-rundown')).toBeVisible()
await expect(page.getByTestId('panel-timer-control')).toBeVisible()
await expect(page.getByTestId('panel-messages-control')).toBeVisible()
await expect(page.getByTestId('panel-info')).toBeVisible()
});
test('cuesheet', async ({ page }) => {
await page.goto('http://localhost:4001/cuesheet');
await expect(page).toHaveTitle(/ontime/);
await page.getByTestId('cuesheet').click();
});
});
test.describe('detached views', () => {
test('rundown', async ({ page }) => {
await page.goto('http://localhost:4001/rundown');
await expect(page.getByTestId('panel-rundown')).toBeVisible()
});
test('timer control', async ({ page }) => {
await page.goto('http://localhost:4001/timercontrol');
await expect(page.getByTestId('panel-timer-control')).toBeVisible()
});
test('message control', async ({ page }) => {
await page.goto('http://localhost:4001/messagecontrol');
await expect(page.getByTestId('panel-messages-control')).toBeVisible()
});
test('info', async ({ page }) => {
await page.goto('http://localhost:4001/info');
await expect(page.getByTestId('panel-info')).toBeVisible()
});
});
});
+31
View File
@@ -0,0 +1,31 @@
import { test, expect } from '@playwright/test';
const fileToUpload = 'e2e/tests/fixtures/test-db.json';
test('project file upload', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Clear rundown' }).click();
await page.getByRole('button', { name: 'toggle settings' }).click();
await page.getByRole('button', { name: 'Project', exact: true }).click();
// workaround to upload file on hidden input
// https://playwright.dev/docs/api/class-filechooser
const fileChooserPromise = page.waitForEvent('filechooser');
await page.getByRole('button', { name: 'Import', exact: true }).click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(fileToUpload);
await page.getByRole('button', { name: 'close' }).click();
// asset test events
const firstTitle = page.getByTestId('entry-1').getByTestId('block__title');
await expect(firstTitle).toHaveValue('Albania');
const secondTitle = page.getByTestId('entry-2').getByTestId('block__title');
await expect(secondTitle).toHaveValue('Latvia');
const thirdTitle = page.getByTestId('entry-3').getByTestId('block__title');
await expect(thirdTitle).toHaveValue('Lithuania');
});
+101
View File
@@ -0,0 +1,101 @@
import { expect, test } from '@playwright/test';
// TODO: can we replace the clicks with something else?
test.describe('pages routes are available', () => {
test.use({ viewport: { width: 1920, height: 1080 } });
test.describe('main views', () => {
test('editor', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await expect(page).toHaveTitle(/ontime/);
await expect(page.getByTestId('editor-container')).toBeVisible();
await expect(page.getByTestId('panel-rundown')).toBeVisible();
await expect(page.getByTestId('panel-timer-control')).toBeVisible();
await expect(page.getByTestId('panel-messages-control')).toBeVisible();
await page.screenshot({ path: 'automated-screenshots/editor.png' });
});
test('cuesheet', async ({ page }) => {
await page.goto('http://localhost:4001/cuesheet');
await expect(page).toHaveTitle(/ontime/);
await page.getByTestId('cuesheet').click();
await page.screenshot({ path: 'automated-screenshots/cuesheet.png' });
});
test('operator', async ({ page }) => {
await page.goto('http://localhost:4001/operator');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/operator.png' });
});
test('timer', async ({ page }) => {
await page.goto('http://localhost:4001/timer');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/timer.png' });
});
test('clock', async ({ page }) => {
await page.goto('http://localhost:4001/timer');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/clock.png' });
});
test('minimal', async ({ page }) => {
await page.goto('http://localhost:4001/minimal');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/minimal.png' });
});
test('backstage', async ({ page }) => {
await page.goto('http://localhost:4001/backstage');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/backstage.png' });
});
test('public', async ({ page }) => {
await page.goto('http://localhost:4001/public');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/public.png' });
});
test('studio', async ({ page }) => {
await page.goto('http://localhost:4001/studio');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/studio.png' });
});
test('countdown', async ({ page }) => {
await page.goto('http://localhost:4001/countdown');
await expect(page).toHaveTitle(/ontime/);
await page.screenshot({ path: 'automated-screenshots/countdown.png' });
await page.getByRole('link', { name: '1. 10:00 → 10:20 | Albania' }).click();
await page.getByText('Albania').click();
await page.screenshot({ path: 'automated-screenshots/countdown-2.png' });
});
});
test.describe('detached views', () => {
test('rundown', async ({ page }) => {
await page.goto('http://localhost:4001/rundown');
await expect(page.getByTestId('panel-rundown')).toBeVisible();
});
test('timer control', async ({ page }) => {
await page.goto('http://localhost:4001/timercontrol');
await expect(page.getByTestId('panel-timer-control')).toBeVisible();
});
test('message control', async ({ page }) => {
await page.goto('http://localhost:4001/messagecontrol');
await expect(page.getByTestId('panel-messages-control')).toBeVisible();
});
});
});
-37
View File
@@ -1,37 +0,0 @@
import { test } from '@playwright/test';
const fileToUpload = 'e2e/tests/fixtures/test-db.json';
test('test project file upload', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Import project file' }).click();
// workaround to upload file on hidden input
// https://playwright.dev/docs/api/class-filechooser
const [fileChooser] = await Promise.all([
page.waitForEvent('filechooser'),
await page.getByText('Click to select Ontime project or xlsx rundown').click(),
]);
await fileChooser.setFiles(fileToUpload);
// there is only one step for normal imports
await page.getByRole('button', { name: 'Import' }).click();
// asset test events
await page.getByPlaceholder('Start').first().click();
await page.getByText('First test event').click();
await page.getByTestId('delay-input').click();
await page
.locator('div')
.filter({ hasText: /^SED\+10 minNew start: 10:10:00$/ })
.getByPlaceholder('Start')
.click();
await page.getByText('+10 minNew start: 10:10:00').click();
await page.getByText('Second test event').click();
await page.getByText('Lunch').click();
await page.getByText('Third test event').click();
});
@@ -7,50 +7,50 @@ test.describe('test view navigation feature', () => {
await page.locator('data-test-id=timer-view');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Clock', exact: true }).click();
await page.locator('data-test-id=clock-view');
await expect(page).toHaveURL('http://localhost:4001/clock');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Minimal Timer' }).click();
await page.locator('data-test-id=minimal-timer');
await expect(page).toHaveURL('http://localhost:4001/minimal');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Backstage' }).click();
await page.locator('data-test-id=backstage-view');
await expect(page).toHaveURL('http://localhost:4001/backstage');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Public' }).click();
await page.locator('data-test-id=public-view');
await expect(page).toHaveURL('http://localhost:4001/public');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Lower Thirds' }).click();
await expect(page).toHaveURL('http://localhost:4001/lower');
const errorBoundary = await page.locator('data-test-id=error-container');
await expect(errorBoundary).toHaveCount(0);
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Studio Clock' }).click();
await page.locator('data-test-id=studio-view');
await expect(page).toHaveURL('http://localhost:4001/studio');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Countdown' }).click();
await page.locator('data-test-id=countdown-view');
await expect(page).toHaveURL('http://localhost:4001/countdown');
await page.getByRole('button', { name: 'toggle menu' }).click();
await page.locator('data-test-id=navigation-menu');
await page.locator('data-test-id=navigation__menu');
await page.getByRole('link', { name: 'Timer', exact: true }).click();
await page.locator('data-test-id=timer-view');
await expect(page).toHaveURL('http://localhost:4001/timer');
+2 -10
View File
@@ -1,4 +1,4 @@
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
test('message control sends messages to screens', async ({ context }) => {
const editorPage = await context.newPage();
@@ -20,7 +20,7 @@ test('message control sends messages to screens', async ({ context }) => {
await editorPage.getByPlaceholder('Shown in lower third').fill('testing lower');
await editorPage.getByRole('button', { name: /toggle lower third message/i }).click();
await featurePage.goto('http://localhost:4001/lower');
await featurePage.goto('http://localhost:4001/lower?trigger=manual&bottom-src=lowerMsg');
await featurePage.waitForLoadState('load', { timeout: 5000 });
await featurePage.getByText('testing lower').click({ timeout: 5000 });
@@ -32,12 +32,4 @@ test('message control sends messages to screens', async ({ context }) => {
await featurePage.goto('http://localhost:4001/timer');
await featurePage.waitForLoadState('load', { timeout: 5000 });
await featurePage.getByText('testing stage').click();
// on air state
await editorPage.getByTestId('toggle on air').click();
await featurePage.goto('http://localhost:4001/studio');
await featurePage.getByText('ON AIR').click();
const onAirActive = await featurePage.locator('data-testid=on-air-enabled');
await expect(onAirActive).toHaveText(/on air/i);
});
+6 -58
View File
@@ -1,63 +1,11 @@
import { expect, test } from '@playwright/test';
import fs from 'fs';
import { test } from '@playwright/test';
test('cuesheet displays events and exports csv', async ({ page }) => {
// ensure elements exist in editor
await page.goto('http://localhost:4001/editor');
await page.getByText('First test event').click();
await page.getByText('Second test event').click();
await page.getByText('Third test event').click();
await page.getByText('Add timeSubtract timeApplyCancel').click();
await page.getByText('Lunch').click();
// same elements in cuesheet
await page.goto('http://localhost:4001/cuesheet');
await page.getByText('All about Carlos demo event').click();
await page.getByRole('cell', { name: 'First test event' }).click();
await page.getByRole('cell', { name: 'Second test event' }).click();
await page.getByRole('cell', { name: 'Third test event' }).click();
await page.getByRole('cell', { name: '+10 min' }).click();
await page.getByRole('cell', { name: 'Lunch' }).click();
const downloadPromise = page.waitForEvent('download');
await page.getByTestId('cuesheet').getByText('Export').click();
await page.getByText('CSV').click();
// From here we test the CSV download feature
function validateCSV(contents) {
// We should try to keep this in sync with the implementation over at cuesheetUtils.ts
const expectedHeader = ['All about Carlos demo event', 'www.getontime.no'];
const expectedColumns = [
'Time Start',
'Time End',
'Event Title',
'Presenter Name',
'Event Subtitle',
'Public',
'Note',
'Colour',
'End Action',
'Timer Type',
'Skip',
'user0',
'user1',
'user2',
'user3',
'user4',
'user5',
'user6',
'user7',
'user8',
'user9',
];
const expectedValues = ['First test event', 'Second test event', 'Third test event', 'Lunch'];
const allExpected = [...expectedHeader, ...expectedColumns, ...expectedValues];
return allExpected.every((value) => contents.includes(value));
}
const download = await downloadPromise;
const contents = await fs.promises.readFile(await download.path(), 'utf-8');
expect(contents).toContain('All about Carlos demo event');
expect(validateCSV(contents)).toBe(true);
await page.getByText('Eurovision Song Contest').click();
await page.getByRole('cell', { name: 'Lunch break' }).click();
await page.getByRole('cell', { name: 'Albania' }).click();
await page.getByRole('cell', { name: 'Latvia' }).click();
await page.getByRole('cell', { name: 'Lithuania' }).click();
});
+35 -40
View File
@@ -4,86 +4,81 @@ test('delay blocks add time to events', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
// delete all events and add a new one
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Add event at start' }).click();
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Clear rundown' }).click();
await page.getByRole('button', { name: 'Create event' }).click();
// add data to new event
await page.getByTestId('panel-rundown').getByPlaceholder('Start').click();
await page.getByTestId('panel-rundown').getByPlaceholder('Start').fill('10m');
await page.getByTestId('panel-rundown').getByPlaceholder('Start').press('Enter');
await page.getByTestId('panel-rundown').getByPlaceholder('End').click();
await page.getByTestId('panel-rundown').getByPlaceholder('End').fill('20m');
await page.getByTestId('panel-rundown').getByPlaceholder('End').press('Enter');
await page.getByTestId('rundown').getByPlaceholder('Start').click();
await page.getByTestId('rundown').getByPlaceholder('Start').fill('10m');
await page.getByTestId('rundown').getByPlaceholder('Start').press('Enter');
await page.getByTestId('rundown').getByPlaceholder('Duration').click();
await page.getByTestId('rundown').getByPlaceholder('Duration').fill('20m');
await page.getByTestId('rundown').getByPlaceholder('Duration').press('Enter');
// add delay block
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Add delay at start' }).click();
await page.getByRole('button', { name: 'Delay' }).nth(0).click();
// fill positive delay
await page.getByTestId('delay-input').click();
await page.getByTestId('delay-input').fill('2m');
await page.getByTestId('delay-input').press('Enter');
await page.getByText('+2 minNew start: 00:12:00').click();
await page.getByText('New start 00:12').click();
// make negative delay
await page.getByText('Subtract time').click();
await page.getByText('-2 minNew start: 00:08:00').click();
await page.getByText('New start 00:08').click();
// apply delay
await page.getByRole('button', { name: 'Apply' }).click();
await expect(page.getByTestId('panel-rundown').getByTestId('time-input-timeStart')).toHaveValue('00:08:00');
await page.getByRole('button', { name: 'Make permanent' }).click();
await expect(page.getByTestId('rundown').getByTestId('time-input-timeStart')).toHaveValue('00:08:00');
// add new delay
await page.getByTestId('panel-rundown').getByPlaceholder('Start').click();
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Add delay at start' }).click();
await page.getByTestId('rundown').getByPlaceholder('Start').click();
await page.getByRole('button', { name: 'Delay' }).nth(0).click();
await page.getByTestId('delay-input').click();
await page.getByTestId('delay-input').fill('10m');
await page.getByTestId('delay-input').press('Enter');
await page.getByText('+10 minNew start: 00:18:00').click();
await page.getByText('New start 00:18').click();
// cancel delay
await page.getByRole('button', { name: 'Cancel' }).click();
await expect(page.getByTestId('panel-rundown').getByTestId('time-input-timeStart')).toHaveValue('00:08:00');
await expect(page.getByText('+10 minNew start: 00:18:00')).toHaveCount(0);
await expect(page.getByTestId('rundown').getByTestId('time-input-timeStart')).toHaveValue('00:08:00');
await expect(page.getByText('New start 00:18')).toHaveCount(0);
});
test('delays are show correctly', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
// add a test event
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Clear rundown' }).click();
await page.getByRole('button', { name: 'Create Event' }).click();
await page.getByTestId('time-input-timeStart').click();
await page.getByTestId('panel-rundown').getByTestId('time-input-timeStart').click();
await page.getByTestId('panel-rundown').getByTestId('time-input-timeStart').fill('10');
await page.getByTestId('panel-rundown').getByTestId('time-input-timeStart').press('Enter');
await page.getByTestId('panel-rundown').getByTestId('time-input-timeEnd').click();
await page.getByTestId('panel-rundown').getByTestId('time-input-timeEnd').fill('20');
await page.getByTestId('panel-rundown').getByTestId('time-input-timeEnd').press('Enter');
await page.getByText('Event title').click();
await page.getByPlaceholder('Event title').fill('test');
await page.getByPlaceholder('Event title').press('Enter');
await page.getByText('SED').click({ button: 'right' });
await page.getByRole('menuitem', { name: 'Toggle public' }).click();
await page.getByTestId('time-input-timeStart').click();
await page.getByTestId('rundown').getByTestId('time-input-timeStart').click();
await page.getByTestId('rundown').getByTestId('time-input-timeStart').fill('10');
await page.getByTestId('rundown').getByTestId('time-input-timeStart').press('Enter');
await page.getByTestId('rundown').getByTestId('time-input-duration').click();
await page.getByTestId('rundown').getByTestId('time-input-duration').fill('10');
await page.getByTestId('rundown').getByTestId('time-input-duration').press('Enter');
await page.getByTestId('block__title').click();
await page.getByTestId('block__title').fill('test');
await page.getByTestId('block__title').press('Enter');
await expect(page.getByTestId('entry-1').locator('#block-status')).toHaveAttribute('data-ispublic', 'true');
// add a delay
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Add delay at start' }).click();
await page.getByRole('button', { name: 'Delay' }).nth(0).click();
await page.getByTestId('delay-input').click();
await page.getByTestId('delay-input').fill('1');
await page.getByTestId('delay-input').press('Enter');
// delay is shown in the editor
await page.getByText('+1 minNew start: 00:11:00').click();
await page.getByText('New start 00:11').click();
// delay is shown in the cuesheet
await page.goto('http://localhost:4001/cuesheet');
await page.getByRole('cell', { name: '+1 min' }).click();
await page.getByRole('cell', { name: 'Delayed by 1 min' }).click();
// delay is NOT shown in the public view
await page.goto('http://localhost:4001/public');
+11 -16
View File
@@ -4,29 +4,24 @@ test('CRUD operations on the rundown', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
// clear rundown
await page.getByRole('button', { name: 'Run mode' }).click();
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Clear rundown' }).click();
// create event from the rundown empty button
await page.getByRole('button', { name: 'Create Event' }).click();
// create blocks using the quick add buttons
await page.getByRole('button', { name: 'Block' }).click();
await page.getByRole('button', { name: 'Delay' }).click();
await page.getByTestId('quick-add-event').click();
await page.getByRole('button', { name: 'Block' }).nth(1).click();
await page.getByRole('button', { name: 'Delay' }).nth(1).click();
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
// test quick add options - start is last end
await page.getByTestId('entry-2').getByTestId('time-input-timeEnd').fill('20m');
await page.getByText('Start time is last end').click();
await page.getByTestId('quick-add-event').click();
await expect(await page.getByTestId('entry-3').getByTestId('time-input-timeStart').inputValue()).toContain(
'00:20:00',
);
// 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();
expect(await page.getByTestId('entry-3').getByTestId('time-input-timeStart').inputValue()).toContain('00:30:00');
// test quick add options - event is public
await page.locator('label').filter({ hasText: 'Event is public' }).click();
await page.getByTestId('quick-add-event').click();
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await expect(await page.getByTestId('entry-4').getByRole('img').nth(3)).toHaveAttribute('data-ispublic', 'true');
await expect(page.getByTestId('entry-4').locator('#block-status')).toHaveAttribute('data-ispublic', 'true');
});
+38 -31
View File
@@ -3,44 +3,49 @@ import { test, expect } from '@playwright/test';
test('smoke test operator', async ({ page }) => {
// make some boilerplate
await page.goto('http://localhost:4001/editor');
await page.getByRole('button', { name: 'Run mode' }).click();
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Clear rundown' }).click();
await page.getByRole('button', { name: 'Create Event' }).click();
await page.getByTestId('time-input-timeStart').fill('1m');
await page.getByTestId('time-input-timeStart').press('Enter');
await page.getByTestId('time-input-durationOverride').fill('1m');
await page.getByTestId('time-input-durationOverride').press('Enter');
await page.getByTestId('time-input-duration').fill('1m');
await page.getByTestId('time-input-duration').press('Enter');
await page.getByText('Start time is last end').click();
await page.getByTestId('quick-add-event').click();
await page.getByTestId('entry-2').getByTestId('time-input-durationOverride').fill('1m');
await page.getByTestId('entry-2').getByTestId('time-input-durationOverride').press('Enter');
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await page.getByTestId('entry-2').getByTestId('lock__duration').click();
await page.getByTestId('entry-2').getByTestId('time-input-duration').fill('1m');
await page.getByTestId('entry-2').getByTestId('time-input-duration').press('Enter');
await page.getByTestId('entry-2').getByTestId('time-input-duration').press('Enter');
await page.getByText('Start time is last end').click();
await page.getByTestId('quick-add-event').click();
await page.getByTestId('entry-3').getByTestId('time-input-durationOverride').fill('1m');
await page.getByTestId('entry-3').getByTestId('time-input-durationOverride').press('Enter');
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await page.getByTestId('entry-3').getByTestId('lock__duration').click();
await page.getByTestId('entry-3').getByTestId('time-input-duration').fill('1m');
await page.getByTestId('entry-3').getByTestId('time-input-duration').press('Enter');
await page.getByRole('button', { name: 'Event...' }).click();
await page.getByRole('menuitem', { name: 'Add block at start' }).click();
await page.getByTestId('quick-add-block').click();
await page.getByRole('button', { name: 'Block' }).nth(1).click();
await page.getByTestId('entry-1').getByRole('button', { name: 'Event options' }).first().click();
await page.getByLabel('Title', { exact: true }).click();
await page.getByLabel('Title', { exact: true }).fill('title 1');
await page.getByLabel('Title', { exact: true }).press('Enter');
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByTestId('entry-1').click();
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await page.getByTestId('entry-2').getByRole('button', { name: 'Event options' }).first().click();
await page.getByLabel('Title', { exact: true }).click();
await page.getByLabel('Title', { exact: true }).fill('title 2');
await page.getByLabel('Title', { exact: true }).press('Enter');
await page.getByTestId('entry-1').getByTestId('block__title').click();
await page.getByTestId('entry-1').getByTestId('block__title').fill('title 1');
await page.getByTestId('entry-1').getByTestId('block__title').press('Enter');
await page.getByTestId('entry-3').getByRole('button', { name: 'Event options' }).first().click();
await page.getByLabel('Title', { exact: true }).click();
await page.getByLabel('Title', { exact: true }).fill('title 3');
await page.getByLabel('Title', { exact: true }).press('Enter');
await page.getByTestId('entry-2').click();
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await page.getByTestId('entry-2').getByTestId('block__title').click();
await page.getByTestId('entry-2').getByTestId('block__title').fill('title 2');
await page.getByTestId('entry-2').getByTestId('block__title').press('Enter');
await page.getByTestId('entry-3').click();
await page.getByRole('button', { name: 'Event', exact: true }).nth(1).click();
await page.getByTestId('entry-3').getByTestId('block__title').click();
await page.getByTestId('entry-3').getByTestId('block__title').fill('title 3');
await page.getByTestId('entry-3').getByTestId('block__title').press('Enter');
// start an event
await page.getByTestId('panel-timer-control').getByRole('button', { name: 'Start' }).click();
@@ -50,7 +55,9 @@ test('smoke test operator', async ({ page }) => {
await expect(page.getByText('title 1')).toBeInViewport();
await expect(page.getByText('title 2')).toBeInViewport();
await expect(page.getByText('title 3')).toBeInViewport();
await expect(page.getByText('00:01 - 00:02')).toBeInViewport();
await expect(page.getByText('00:02 - 00:03')).toBeInViewport();
await expect(page.getByText('00:03 - 00:04')).toBeInViewport();
// TODO: this part seems particularly flaky, to revise
// await expect(page.getByText('00:01 - 00:02')).toBeInViewport();
// await expect(page.getByText('00:02 - 00:03')).toBeInViewport();
// await expect(page.getByText('00:03 - 00:04')).toBeInViewport();
});
-21
View File
@@ -1,21 +0,0 @@
import { test, expect } from '@playwright/test';
test('test aliases feature, it should redirect to given alias', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
// open settings
await page.getByRole('button', { name: 'Settings' }).click();
await page.getByRole('tab', { name: 'URL Aliases' }).click();
// create alias
await page.getByRole('button', { name: 'Add new' }).click();
await page.getByTestId('field__alias_1').fill('testing');
await page.getByTestId('field__url_1').fill('countdown');
await page.getByTestId('field__enable_1').click();
await page.getByRole('button', { name: 'Save', exact: true }).click();
await page.getByRole('button', { name: 'Close' }).click();
// make sure alias works
await page.goto('http://localhost:4001/testing');
await page.getByText('Select an event to follow').click();
});
+30
View File
@@ -0,0 +1,30 @@
import { expect, test } from '@playwright/test';
test('URL preset feature, it should redirect to given URL', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
// open settings
await page.getByRole('button', { name: 'Toggle settings' }).click();
await page.getByRole('button', { name: 'Feature Settings' }).click();
// create preset
await page.getByTestId('url-preset-form').scrollIntoViewIfNeeded();
await page.getByTestId('url-preset-form').getByRole('button', { name: 'New' }).scrollIntoViewIfNeeded();
await page.getByTestId('url-preset-form').getByRole('button', { name: 'New' }).click();
await page.getByTestId('field__alias_0').click();
await page.getByTestId('field__alias_0').fill('testing');
await page.getByTestId('field__url_0').click();
await page.getByTestId('field__url_0').fill('countdown');
await page.getByTestId('field__enable_0').click();
await page.getByTestId('url-preset-form').getByRole('button', { name: 'Save', exact: true }).click();
// make sure preset works
await page.goto('http://localhost:4001/testing');
await page.getByTestId('countdown__select').click();
await expect(page.getByTestId('countdown__select')).toBeVisible();
});
@@ -0,0 +1,14 @@
import { test, expect } from '@playwright/test';
test('View params configures timer view', async ({ page }) => {
await page.goto('http://localhost:4001/timer');
await expect(page.getByText('TIME NOW')).toBeInViewport();
await page.getByTestId('navigation__toggle-settings').click();
await page.locator('label').filter({ hasText: 'Hide Time NowHides the Time' }).locator('span').nth(2).click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByText('TIME NOW', { exact: true })).not.toBeInViewport();
await expect(page).toHaveURL(/.*hideClock=true/);
});
+18
View File
@@ -0,0 +1,18 @@
import { test, expect } from '@playwright/test';
test('Aux timer buttons', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await page.getByTestId('time-input-auxTimer').click();
await page.getByTestId('time-input-auxTimer').fill('123456');
await page.getByTestId('time-input-auxTimer').press('Enter');
await expect(page.getByTestId('time-input-auxTimer')).toHaveValue('12:34:56');
await page.getByTestId('aux-timer-start').click();
await expect(page.getByTestId('time-input-auxTimer')).toHaveValue('12:34:53', { timeout: 4000 });
await page.getByTestId('aux-timer-pause').click();
await expect(page.getByTestId('time-input-auxTimer')).toHaveValue('12:34:53');
await page.getByTestId('aux-timer-stop').click();
await expect(page.getByTestId('time-input-auxTimer')).toHaveValue('12:34:56');
await page.getByTestId('aux-timer-direction').click();
await page.getByTestId('aux-timer-start').click();
await expect(page.getByTestId('time-input-auxTimer')).toHaveValue('12:34:59', { timeout: 4000 });
});
@@ -0,0 +1,37 @@
import { expect, test } from '@playwright/test';
const fileToUpload = 'e2e/tests/fixtures/test-sheet.xlsx';
test('sheet file upload', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
await page.getByRole('button', { name: 'Edit' }).click();
await page.getByRole('button', { name: 'Clear rundown' }).click();
await page.getByRole('button', { name: 'Toggle settings' }).click();
await page.getByRole('button', { name: 'Import spreadsheet' }).click();
// workaround to upload file on hidden input
// https://playwright.dev/docs/api/class-filechooser
const fileChooserPromise = page.waitForEvent('filechooser');
await page.getByRole('button', { name: 'Import from spreadsheet', exact: true }).click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(fileToUpload);
await page.locator('[id="event\\ schedule"]').selectOption('Sheet2');
await page.locator('[id="event\\ schedule"]').selectOption('test');
await page.getByRole('button', { name: 'Import preview' }).click();
await page.getByRole('button', { name: 'Apply' }).click();
await page.getByRole('button', { name: 'Return' }).click();
await page.getByLabel('close').click();
// asset test events
const firstTitle = page.getByTestId('entry-1').getByTestId('block__title');
await expect(firstTitle).toHaveValue('Attempt light check');
const secondTitle = page.getByTestId('entry-2').getByTestId('block__title');
await expect(secondTitle).toHaveValue('Preset');
const thirdTitle = page.getByTestId('entry-3').getByTestId('block__title');
await expect(thirdTitle).toHaveValue('Albania');
});
+14
View File
@@ -0,0 +1,14 @@
import { expect, test as base } from '@playwright/test';
// fail tests which contain errors
export const test = base.extend({
page: async ({ page }, use) => {
const messages = [];
page.on('pageerror', (exception) => {
console.log(`Uncaught exception: "${exception.message}"`);
messages.push(exception);
});
await use(page);
expect(messages).toEqual([]);
},
});
+291 -103
View File
@@ -1,105 +1,303 @@
{
"rundown": [
{
"title": "First test event",
"subtitle": "",
"presenter": "",
"note": "",
"endAction": "none",
"timerType": "count-down",
"timeStart": 32400000,
"timeEnd": 36000000,
"duration": 3600000,
"isPublic": true,
"skip": false,
"colour": "",
"user0": "",
"user1": "",
"user2": "",
"user3": "",
"user4": "",
"user5": "",
"user6": "",
"user7": "",
"user8": "",
"user9": "",
"type": "event",
"revision": 4,
"id": "aa42f"
},
{
"duration": 600000,
"type": "delay",
"revision": 0,
"id": "b1d5a"
},
{
"title": "Second test event",
"subtitle": "",
"presenter": "",
"note": "",
"title": "Albania",
"note": "SF1.01",
"endAction": "none",
"timerType": "count-down",
"timeStart": 36000000,
"timeEnd": 39600000,
"duration": 3600000,
"timeEnd": 37200000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"user0": "",
"user1": "",
"user2": "",
"user3": "",
"user4": "",
"user5": "",
"user6": "",
"user7": "",
"user8": "",
"user9": "",
"type": "event",
"revision": 2,
"id": "d71bc"
"revision": 0,
"id": "32d31",
"cue": "SF1.01",
"custom": {
"song": "Sekret",
"artist": "Ronela Hajati"
}
},
{
"title": "Lunch",
"type": "block",
"id": "91682"
},
{
"title": "Third test event",
"subtitle": "",
"presenter": "",
"note": "",
"title": "Latvia",
"note": "SF1.02",
"endAction": "none",
"timerType": "count-down",
"timeStart": 39600000,
"timeEnd": 720000,
"duration": 47520000,
"timeStart": 37500000,
"timeEnd": 38700000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"user0": "",
"user1": "",
"user2": "",
"user3": "",
"user4": "",
"user5": "",
"user6": "",
"user7": "",
"user8": "",
"user9": "",
"type": "event",
"revision": 2,
"id": "da5b4"
"revision": 0,
"id": "21cd2",
"cue": "SF1.02",
"custom": {
"song": "Eat Your Salad",
"artist": "Citi Zeni"
}
},
{
"title": "Lithuania",
"note": "SF1.03",
"endAction": "none",
"timerType": "count-down",
"timeStart": 39000000,
"timeEnd": 40200000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "0b371",
"cue": "SF1.03",
"custom": {
"song": "Sentimentai",
"artist": "Monika Liu"
}
},
{
"title": "Switzerland",
"note": "SF1.04",
"endAction": "none",
"timerType": "count-down",
"timeStart": 40500000,
"timeEnd": 41700000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "3cd28",
"cue": "SF1.04",
"custom": {
"song": "Boys Do Cry",
"artist": "Marius Bear"
}
},
{
"title": "Slovenia",
"note": "SF1.05",
"endAction": "none",
"timerType": "count-down",
"timeStart": 42000000,
"timeEnd": 43200000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "e457f",
"cue": "SF1.05",
"custom": {
"song": "Disko",
"artist": "LPS"
}
},
{
"title": "Lunch break",
"type": "block",
"id": "01e85"
},
{
"title": "Ukraine",
"note": "SF1.06",
"endAction": "none",
"timerType": "count-down",
"timeStart": 47100000,
"timeEnd": 48300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "1c420",
"cue": "SF1.06",
"custom": {
"song": "Stefania",
"artist": "Kalush Orchestra"
}
},
{
"title": "Bulgaria",
"note": "SF1.07",
"endAction": "none",
"timerType": "count-down",
"timeStart": 48600000,
"timeEnd": 49800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "b7737",
"cue": "SF1.07",
"custom": {
"song": "Intention",
"artist": "Intelligent Music Project"
}
},
{
"title": "Netherlands",
"note": "SF1.08",
"endAction": "none",
"timerType": "count-down",
"timeStart": 50100000,
"timeEnd": 51300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "d3a80",
"cue": "SF1.08",
"custom": {
"song": "De Diepte",
"artist": "S10"
}
},
{
"title": "Moldova",
"note": "SF1.09",
"endAction": "none",
"timerType": "count-down",
"timeStart": 51600000,
"timeEnd": 52800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "8276c",
"cue": "SF1.09",
"custom": {
"song": "Trenuletul",
"artist": "Zdob si Zdub"
}
},
{
"title": "Portugal",
"note": "SF1.10",
"endAction": "none",
"timerType": "count-down",
"timeStart": 53100000,
"timeEnd": 54300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "2340b",
"cue": "SF1.10",
"custom": {
"song": "Saudade Saudade",
"artist": "Maro"
}
},
{
"title": "Afternoon break",
"type": "block",
"id": "cb90b"
},
{
"title": "Croatia",
"note": "SF1.11",
"endAction": "none",
"timerType": "count-down",
"timeStart": 56100000,
"timeEnd": 57300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "503c4",
"cue": "SF1.11",
"custom": {
"song": "Guilty Pleasure",
"artist": "Mia Dimsic"
}
},
{
"title": "Denmark",
"note": "SF1.12",
"endAction": "none",
"timerType": "count-down",
"timeStart": 57600000,
"timeEnd": 58800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "5e965",
"cue": "SF1.12",
"custom": {
"song": "The Show",
"artist": "Reddi"
}
},
{
"title": "Austria",
"note": "SF1.13",
"endAction": "none",
"timerType": "count-down",
"timeStart": 59100000,
"timeEnd": 60300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "bab4a",
"cue": "SF1.13",
"custom": {
"song": "Halo",
"artist": "LUM!X & Pia Maria"
}
},
{
"title": "Greece",
"note": "SF1.14",
"endAction": "none",
"timerType": "count-down",
"timeStart": 60600000,
"timeEnd": 61800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"type": "event",
"revision": 0,
"id": "d3eb1",
"cue": "SF1.14",
"custom": {
"song": "Die Together",
"artist": "Amanda Tenfjord"
}
}
],
"project": {
"title": "All about Carlos demo event",
"description": "Demo event for Ontime",
"title": "Eurovision Song Contest",
"description": "Turin 2022",
"publicUrl": "www.getontime.no",
"publicInfo": "WiFi: demoproject \nPassword: ontimeproject",
"backstageUrl": "www.getontime.no",
"backstageInfo": "WiFi: demobackstage\nPassword: ontimeproject"
"publicInfo": "Rehearsal Schedule - Turin 2022",
"backstageUrl": "www.github.com/cpvalente/ontime",
"backstageInfo": "Rehearsal Schedule - Turin 2022\nAll performers to wear full costumes for 1st rehearsal"
},
"settings": {
"app": "ontime",
@@ -112,40 +310,30 @@
},
"viewSettings": {
"overrideStyles": false,
"normalColor": "#ffffffcc",
"warningColor": "#FFAB33",
"warningThreshold": 120000,
"dangerColor": "#ED3333",
"dangerThreshold": 60000,
"endMessage": ""
},
"aliases": [
"urlPresets": [
{
"enabled": true,
"alias": "test",
"pathAndParams": "lower?bg=ff2&text=f00&size=0.6&transition=5"
}
],
"userFields": {
"user0": "user0",
"user1": "user1",
"user2": "user2",
"user3": "user3",
"user4": "user4",
"user5": "user5",
"user6": "user6",
"user7": "user7",
"user8": "user8",
"user9": "user9"
},
"osc": {
"portIn": 8888,
"portOut": 9999,
"targetIP": "127.0.0.1",
"enabledIn": false,
"enabledOut": false,
"subscriptions": {
"onLoad": [],
"onStart": [],
"onPause": [],
"onStop": [],
"onUpdate": [],
"onFinish": []
}
"enabledIn": true,
"enabledOut": true,
"subscriptions": []
},
"http": {
"enabledOut": true,
"subscriptions": []
}
}
Binary file not shown.
-25
View File
@@ -1,25 +0,0 @@
import fs from 'fs';
import path from 'path';
// haven't been able to get this to work
// it is well discussed in the issues, so should be able to find something
// https://playwrightsolutions.com/making-a-post/
// https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-fetch
// the upload is accepted by backend we receive 400 after upload and parse
export async function uploadTestDb(request) {
const filePath = path.resolve('e2e/tests/fixtures/test-db.json');
const file = fs.readFileSync(filePath);
const response = await request.post('http://localhost:4001/ontime/db?onlyRundown=false', {
multipart: {
file: {
fileName: filePath,
mimeType: "application/json",
buffer: file,
},
},
});
return response;
}