mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 05:34:09 +00:00
V2 message manager (#234)
* refactor: server run script * refactor: extract message control feature * refactor: socket usage for message control feature * refactor: migrate e2e testing to playwright * chore: add feature tests * refactor: add validation on socket controller * chore: jest tests server logic * chore: update tests * chore: run playwright tests on pull_requests
This commit is contained in:
@@ -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');
|
||||
await editorPage.getByRole('button', { name: 'toggle timer screen message' }).click();
|
||||
|
||||
await featurePage.goto('http://localhost:4001/timer');
|
||||
await featurePage.getByText('testing').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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user