skillhub/web/playwright.config.ts
XiaoSeS d824a0498c
Some checks are pending
Deploy Docs / build (push) Waiting to run
Deploy Docs / Deploy (push) Blocked by required conditions
Security / Dependency Review (push) Waiting to run
Security / CodeQL (java-kotlin) (push) Waiting to run
Security / CodeQL (javascript-typescript) (push) Waiting to run
Security / CodeQL (python) (push) Waiting to run
fix(skill): harden SkillHub CLI guide bootstrap (#842)
* fix(skill): harden SkillHub CLI guide bootstrap

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* test(web): support exact preview browser checks

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* test(skill): enforce guide safety contracts

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(skill): verify CLI package provenance

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* test(web): align CLI provenance assertions

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

---------

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-09-09 20:25:50 +08:00

42 lines
1.2 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
const localNoProxyHosts = ['localhost', '127.0.0.1', '::1']
const mergedNoProxy = Array.from(new Set([
...(process.env.NO_PROXY?.split(',').filter(Boolean) ?? []),
...(process.env.no_proxy?.split(',').filter(Boolean) ?? []),
...localNoProxyHosts,
])).join(',')
process.env.NO_PROXY = mergedNoProxy
process.env.no_proxy = mergedNoProxy
const externalBaseUrl = process.env.PLAYWRIGHT_BASE_URL
const baseURL = externalBaseUrl ?? 'http://127.0.0.1:3000'
export default defineConfig({
testDir: './e2e',
fullyParallel: false,
timeout: process.env.CI ? 90_000 : 45_000,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: Number(process.env.PLAYWRIGHT_WORKERS ?? 1),
reporter: 'html',
use: {
baseURL,
trace: 'on-first-retry',
screenshot: 'on',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: externalBaseUrl
? undefined
: {
command: 'pnpm exec vite --host 127.0.0.1 --port 3000 --strictPort',
url: baseURL,
reuseExistingServer: true,
timeout: 120000,
},
})