mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
V2 monorepo (#285)
* refactor(project structure): UI * refactor(project structure): extract utilities * refactor(project structure): remove unused * refactor(project structure): electron * refactor(project structure): server refactor: migrate to vitest refactor: monorepo config * refactor: extract application menu * refactor: exit process * refactor: extract tray menu * chore: electron build * Added Seconds in studio clock #282 --------- Co-authored-by: Fabian Posenau <fabian@fphome.de> --------- Co-authored-by: Fabian Posenau <fabian.p99@gmx.de> Co-authored-by: Fabian Posenau <fabian@fphome.de>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended"
|
||||
],
|
||||
"plugins": [],
|
||||
"rules": {}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test('test', async ({ context }) => {
|
||||
const editorPage = await context.newPage();
|
||||
const featurePage = await context.newPage();
|
||||
|
||||
await editorPage.goto('http://localhost:4001/messagecontrol');
|
||||
|
||||
// stage timer message
|
||||
await editorPage.getByPlaceholder('Shown in stage timer').click();
|
||||
await editorPage.getByPlaceholder('Shown in stage timer').fill('testing stage');
|
||||
await editorPage.getByRole('button', { name: 'toggle timer screen message' }).click();
|
||||
|
||||
await featurePage.goto('http://localhost:4001/timer');
|
||||
await featurePage.getByText('testing stage').click();
|
||||
|
||||
// public screen message
|
||||
await editorPage.getByPlaceholder('Shown in public screens').click();
|
||||
await editorPage.getByPlaceholder('Shown in public screens').fill('testing public');
|
||||
await editorPage.getByRole('button', { name: /toggle public screen message/i }).click();
|
||||
|
||||
await featurePage.goto('http://localhost:4001/public');
|
||||
await featurePage.getByText('testing public').click();
|
||||
|
||||
// lower third message
|
||||
await editorPage.getByPlaceholder('Shown in lower third').click();
|
||||
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.getByText('testing lower').click();
|
||||
|
||||
// on air state
|
||||
await editorPage.getByRole('button', { name: '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);
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('minimal view behaviour can be changed through params', () => {
|
||||
test.use({ viewport: { width: 1920, height: 1080 } });
|
||||
test('without overloads', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/minimal');
|
||||
await page.getByTestId('minimal-timer').click();
|
||||
});
|
||||
test('hide nav', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/minimal?hidenav=true');
|
||||
const navBar = await page.locator('data-test-id=nav-logo');
|
||||
await expect(navBar).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,64 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('test view navigation feature', () => {
|
||||
test('user flow through links', async ({ page }) => {
|
||||
// default view is timer view
|
||||
await page.goto('http://localhost:4001/');
|
||||
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.getByRole('link', { name: 'Clock' }).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.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.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.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.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.getByRole('link', { name: 'PiP' }).click();
|
||||
await page.locator('data-test-id=pip-view');
|
||||
await expect(page).toHaveURL('http://localhost:4001/pip');
|
||||
|
||||
await page.getByRole('button', { name: 'toggle menu' }).click();
|
||||
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.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.getByRole('link', { name: 'Timer' }).click();
|
||||
await page.locator('data-test-id=timer-view');
|
||||
await expect(page).toHaveURL('http://localhost:4001/timer');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
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 page.getByTestId('event-editor').click();
|
||||
await page.getByTestId('panel-rundown').click();
|
||||
await page.getByTestId('panel-timer-control').click();
|
||||
await page.getByTestId('panel-messages-control').click();
|
||||
await page.getByTestId('panel-info').click();
|
||||
});
|
||||
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 page.getByTestId('panel-rundown').click();
|
||||
});
|
||||
test('timer control', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/timercontrol');
|
||||
await page.getByTestId('panel-timer-control').click();
|
||||
});
|
||||
test('message control', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/messagecontrol');
|
||||
await page.getByTestId('panel-messages-control').click();
|
||||
});
|
||||
test('info', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/info');
|
||||
await page.getByTestId('panel-info').click();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
Reference in New Issue
Block a user