mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-31 11:59:10 +00:00
0d5228f1e5
Three things measured wrong once the preview showed a real render: - the pip timer kept leading zeros where the timer view drops them by default, so the preview read 00:59:07 against the stage's 59:07 - and its own secondary line already dropped them - the extracted /messagecontrol route has no flex parent for the panel to grow into, so the stage collapsed to its minimum instead of filling the window - a tall panel caps the stage at its own width, and the slack it leaves now sits either side of the stage rather than all below it Covers the screen state controls in the e2e spec: the secondary source select puts the typed text on the stage, blackout reaches the timer view, and clear screen resets the state while keeping the text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011CHxSQ6nWHuyar8feieRra
48 lines
2.2 KiB
TypeScript
48 lines
2.2 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
test('message control sends messages to screens', async ({ context }) => {
|
|
const editorPage = await context.newPage();
|
|
const featurePage = await context.newPage();
|
|
|
|
await editorPage.goto('/messagecontrol');
|
|
|
|
// stage timer message
|
|
await editorPage.getByPlaceholder('Message shown fullscreen in stage timer').click();
|
|
await editorPage.getByPlaceholder('Message shown fullscreen in stage timer').fill('testing stage');
|
|
await editorPage.getByRole('button', { name: /toggle timer message/i }).click({ timeout: 5000 });
|
|
|
|
await featurePage.goto('/timer');
|
|
await featurePage.waitForLoadState('load', { timeout: 5000 });
|
|
await expect(featurePage.getByText('testing stage')).toBeVisible();
|
|
|
|
await editorPage.getByRole('button', { name: /toggle timer message/i }).click({ timeout: 5000 });
|
|
|
|
await expect(featurePage.getByText('TIME NOW')).toBeVisible();
|
|
});
|
|
|
|
test('message control drives the stage screen state', async ({ context }) => {
|
|
const editorPage = await context.newPage();
|
|
const featurePage = await context.newPage();
|
|
|
|
await editorPage.goto('/messagecontrol');
|
|
await featurePage.goto('/timer');
|
|
await featurePage.waitForLoadState('load', { timeout: 5000 });
|
|
|
|
// the secondary line defaults to an aux timer, the select is what puts our text on screen
|
|
await editorPage.getByPlaceholder('Message shown as secondary text in stage timer').fill('testing secondary');
|
|
await editorPage.getByRole('combobox').click();
|
|
await editorPage.getByRole('option', { name: 'Message' }).click();
|
|
await expect(featurePage.getByText('testing secondary')).toBeVisible();
|
|
|
|
await editorPage.getByTestId('toggle timer blackout').click();
|
|
await expect(featurePage.locator('.blackout')).toHaveClass(/blackout--active/);
|
|
|
|
// clearing returns the screen to normal, but keeps what the operator typed
|
|
await editorPage.getByTestId('clear screen').click();
|
|
await expect(featurePage.locator('.blackout')).not.toHaveClass(/blackout--active/);
|
|
await expect(featurePage.getByText('testing secondary')).toHaveCount(0);
|
|
await expect(editorPage.getByPlaceholder('Message shown as secondary text in stage timer')).toHaveValue(
|
|
'testing secondary',
|
|
);
|
|
});
|