test: add Playwright UI smoke coverage
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { expect, test } from '@playwright/test'
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/')
|
||||
await page.evaluate(() => localStorage.clear())
|
||||
await page.reload()
|
||||
await expect(page.getByRole('heading', { name: /System Landscape/ })).toBeVisible()
|
||||
})
|
||||
|
||||
test('loads the demo and advances a scenario', async ({ page }) => {
|
||||
await expect(page.locator('.list-area .list-item')).toHaveCount(2)
|
||||
await page.locator('.list-area .run-mini').first().click()
|
||||
await expect(page.locator('.guided-card')).toBeVisible()
|
||||
await expect(page.locator('.guided-card')).not.toContainText('Ready to run')
|
||||
await page.getByRole('button', { name: '›' }).click()
|
||||
await expect(page.locator('.timeline-label')).not.toContainText('0 /')
|
||||
})
|
||||
|
||||
test('places a preset and keeps the new system editable', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Presets' }).click()
|
||||
await page.locator('.preset-item .run-mini').first().click()
|
||||
await expect(page.getByRole('heading', { name: /Place preset/ })).toBeVisible()
|
||||
await page.getByRole('button', { name: 'Place system' }).click()
|
||||
await expect(page.locator('.inspector-content').first()).toContainText('Save system')
|
||||
})
|
||||
|
||||
test('persists an edited scenario across refresh', async ({ page }) => {
|
||||
const name = 'Browser persistence check'
|
||||
await page.locator('.scenario-inspector input').first().fill(name)
|
||||
await page.reload()
|
||||
await expect(page.locator('.scenario-inspector input').first()).toHaveValue(name)
|
||||
})
|
||||
|
||||
test('enters and exits presentation mode', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Presentation mode' }).click()
|
||||
await expect(page.getByRole('button', { name: 'Exit presentation' })).toBeVisible()
|
||||
await expect(page.locator('.topbar')).toBeHidden()
|
||||
await page.getByRole('button', { name: 'Exit presentation' }).click()
|
||||
await expect(page.getByRole('button', { name: 'Presentation mode' })).toBeVisible()
|
||||
})
|
||||
Reference in New Issue
Block a user