chore: smoke test operator

This commit is contained in:
cv
2023-09-02 11:11:51 +02:00
parent 65ba6ae2db
commit 6417a99281
+19
View File
@@ -3,6 +3,7 @@ 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: 'Create Event' }).click();
@@ -26,11 +27,29 @@ test('smoke test operator', async ({ page }) => {
await page.getByRole('menuitem', { name: 'Add block at start' }).click();
await page.getByTestId('quick-add-block').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.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-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');
// start an event
await page.getByTestId('panel-timer-control').getByRole('button', { name: 'Start' }).click();
await page.goto('http://localhost:4001/op');
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();