test: add Playwright UI smoke coverage

This commit is contained in:
2026-11-09 08:17:28 +00:00
parent b7ebf90c96
commit 3fdab5902a
6 changed files with 117 additions and 1 deletions
+3
View File
@@ -1,6 +1,9 @@
node_modules node_modules
dist dist
.vs .vs
.playwright/
playwright-report
test-results
.DS_Store .DS_Store
src/*.js src/*.js
vite.config.js vite.config.js
+4
View File
@@ -50,6 +50,10 @@ The initial landscape contains Website, API, ERP, CRM and Email Platform plus tw
```bash ```bash
npm test npm test
npm run build npm run build
# Browser UI smoke tests (requires a Playwright browser install once)
npx playwright install chromium
npm run test:ui
``` ```
## Limitations ## Limitations
+46
View File
@@ -12,6 +12,7 @@
"vue": "^3.5.22" "vue": "^3.5.22"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.65.0",
"@types/node": "^26.6.6", "@types/node": "^26.6.6",
"@vitejs/plugin-vue": "^6.0.1", "@vitejs/plugin-vue": "^6.0.1",
"jsdom": "^26.1.0", "jsdom": "^26.1.0",
@@ -644,6 +645,22 @@
"integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@playwright/test": {
"version": "1.65.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.0.tgz",
"integrity": "sha512-iGURLGuKDLakSEl7Pgfv8h7f+XLT+V861Wfhz0zlEl5nyFuKUopdkFBPKqTllTUp06aOwPuH8iuUEb3yp3MpbQ==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.65.0"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@rolldown/pluginutils": { "node_modules/@rolldown/pluginutils": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
@@ -1898,6 +1915,35 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/playwright": {
"version": "1.65.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.0.tgz",
"integrity": "sha512-F3AMWcR44qMBt4kq+6Kb6mX7bjGXshktKFOPULd7reED6ZJWevjbNRqysP7q+AATE9kdPEZBibex1BYsvpVoeA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.65.0"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/playwright-core": {
"version": "1.65.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.0.tgz",
"integrity": "sha512-vNSKgH6YqtN7cdT/L334zo0a+YwkrpicyrHJlWWPIm/Q+Nn2SWInil01oT0mbu96U4GgoRtCYQD9CzJQgju+lA==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.5.32", "version": "8.5.32",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz",
+3 -1
View File
@@ -6,13 +6,15 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build",
"test": "vitest run src/model.test.ts" "test": "vitest run src/model.test.ts",
"test:ui": "playwright test"
}, },
"dependencies": { "dependencies": {
"litegraph.js": "^0.7.18", "litegraph.js": "^0.7.18",
"vue": "^3.5.22" "vue": "^3.5.22"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.65.0",
"@types/node": "^26.6.6", "@types/node": "^26.6.6",
"@vitejs/plugin-vue": "^6.0.1", "@vitejs/plugin-vue": "^6.0.1",
"jsdom": "^26.1.0", "jsdom": "^26.1.0",
+21
View File
@@ -0,0 +1,21 @@
import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './tests',
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
reporter: 'html',
use: {
baseURL: 'http://127.0.0.1:5173',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
webServer: {
command: 'npm run dev -- --host 127.0.0.1',
url: 'http://127.0.0.1:5173',
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
})
+40
View File
@@ -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()
})