Navigation (#850)

This commit is contained in:
Carlos Valente
2024-03-27 21:02:40 +01:00
committed by GitHub
parent f5e9a2549e
commit ce14aabcd7
46 changed files with 476 additions and 614 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ test('test project file upload', async ({ page }) => {
await page.getByRole('button', { name: 'Rundown menu' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Application settings' }).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
+8 -8
View File
@@ -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');
+1 -33
View File
@@ -1,5 +1,4 @@
import { expect, test } from '@playwright/test';
import fs from 'fs';
import { test } from '@playwright/test';
test('cuesheet displays events and exports csv', async ({ page }) => {
// same elements in cuesheet
@@ -9,35 +8,4 @@ test('cuesheet displays events and exports csv', async ({ page }) => {
await page.getByRole('cell', { name: 'Albania' }).click();
await page.getByRole('cell', { name: 'Latvia' }).click();
await page.getByRole('cell', { name: 'Lithuania' }).click();
// From here we test the CSV download feature
const downloadPromise = page.waitForEvent('download');
await page.getByTestId('cuesheet').getByText('Export CSV').click();
function validateCSV(contents: string) {
// We should try to keep this in sync with the implementation over at cuesheetUtils.ts
const expectedHeader = ['Project title: Eurovision Song Contest', 'Project description: Turin 2022'];
const expectedColumns = [
'Time Start',
'Time End',
'Duration',
'ID',
'Colour',
'Cue',
'Title',
'Note',
'Is Public? (x)',
'Skip?',
];
const expectedValues = ['Albania', 'Latvia', 'Lithuania', 'Lunch break'];
const allExpected = [...expectedHeader, ...expectedColumns, ...expectedValues];
return allExpected.every((value) => {
return contents.toLowerCase().includes(value.toLowerCase());
});
}
const download = await downloadPromise;
const contents = await fs.promises.readFile(await download.path(), 'utf-8');
expect(validateCSV(contents)).toBe(true);
});
+1 -1
View File
@@ -4,7 +4,7 @@ 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: 'Application settings' }).click();
await page.getByTestId('navigation__toggle-settings').click();
await page.getByRole('button', { name: 'General' }).click();
// create preset
@@ -7,7 +7,7 @@ test('sheet file upload', async ({ page }) => {
await page.getByRole('button', { name: 'Rundown menu' }).click();
await page.getByRole('menuitem', { name: 'Delete all events' }).click();
await page.getByRole('button', { name: 'Application settings' }).click();
await page.getByTestId('navigation__toggle-settings').click();
await page.getByRole('button', { name: 'Import spreadsheet' }).click();
// workaround to upload file on hidden input