Zum Inhalt

tests/e2e/slice1.spec.ts

import { expect, test } from '@playwright/test';

test('app loads and topbar shows brand', async ({ page }) => {
  await page.goto('/');
  await expect(page.getByText('Physarum')).toBeVisible();
  await expect(page.getByText(/v\d+\.\d+/)).toBeVisible();
});

test('keyboard L opens library', async ({ page }) => {
  await page.goto('/');
  await page.waitForTimeout(500);
  await page.keyboard.press('l');
  await expect(page.getByText('Preset Library')).toBeVisible();
  await page.keyboard.press('Escape');
  await expect(page.getByText('Preset Library')).not.toBeVisible();
});

test('keyboard E opens editor', async ({ page }) => {
  await page.goto('/');
  await page.waitForTimeout(500);
  await page.keyboard.press('e');
  await expect(page.getByText('Editing')).toBeVisible();
});

test('keyboard C enters cinema mode (preset name visible large)', async ({ page }) => {
  await page.goto('/');
  await page.waitForTimeout(500);
  await page.keyboard.press('c');
  await expect(page.getByText(/Cinema · .*click to exit/)).toBeVisible();
});