mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
- Move setup-browser-globals import to top to fix location undefined error - Skip user setup for i18n tests to avoid duplicate user conflicts - Run i18n tests serially with workers=1 to prevent race conditions - Add unique test-based usernames for better test isolation
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { defineConfig } from '@playwright/test'
|
|
import path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
const config: any = defineConfig({
|
|
testDir: './scripts',
|
|
use: {
|
|
baseURL: 'http://localhost:5173',
|
|
headless: true
|
|
},
|
|
reporter: 'list',
|
|
timeout: 60000,
|
|
workers: 1, // Run tests serially to avoid duplicate user creation
|
|
testMatch: /collect-i18n-.*\.ts/,
|
|
// Start dev server before running tests
|
|
webServer: {
|
|
command: 'pnpm dev',
|
|
url: 'http://localhost:5173',
|
|
reuseExistingServer: true,
|
|
timeout: 60000
|
|
}
|
|
})
|
|
|
|
// Configure babel plugins for TypeScript with declare fields and module resolution
|
|
config['@playwright/test'] = {
|
|
babelPlugins: [
|
|
// Stub Vue and CSS imports first to prevent parsing errors
|
|
[path.join(__dirname, 'babel-plugin-stub-vue-imports.cjs')],
|
|
// Module resolver to handle @ alias
|
|
[
|
|
'babel-plugin-module-resolver',
|
|
{
|
|
root: ['./'],
|
|
alias: {
|
|
'@': './src'
|
|
}
|
|
}
|
|
],
|
|
// Then TypeScript transformation with declare field support
|
|
[
|
|
'@babel/plugin-transform-typescript',
|
|
{
|
|
allowDeclareFields: true,
|
|
onlyRemoveTypeImports: true
|
|
}
|
|
]
|
|
]
|
|
}
|
|
|
|
export default config
|