* a new hope * run tests in ci against cli mode * summary * try vercel action to run e2e against studio self hosted preview * believe * debug * gh pages artifact * test * rm pages step * fix automation bypass missing * continue on error * only install necessary deps for CI * fix bypass * remove * fail job if test fails * disable customer query if is_platform false * vercel check * fix var name, make comment update instead * check bypass on runtime * add env var * fix tests going to project ref instead of default * fix * better dates in comment * Update E2E test workflow to include flaky test detection and improve summary output * fix * fix dumb mistake
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { defineConfig } from '@playwright/test'
|
|
import { env, STORAGE_STATE_PATH } from './env.config'
|
|
import dotenv from 'dotenv'
|
|
import path from 'path'
|
|
|
|
dotenv.config({ path: path.resolve(__dirname, '.env.local') })
|
|
|
|
const IS_CI = !!process.env.CI
|
|
|
|
export default defineConfig({
|
|
timeout: 90 * 1000,
|
|
testDir: './features',
|
|
testMatch: /.*\.spec\.ts/,
|
|
forbidOnly: IS_CI,
|
|
retries: IS_CI ? 3 : 0,
|
|
maxFailures: 3,
|
|
fullyParallel: true,
|
|
use: {
|
|
baseURL: env.STUDIO_URL,
|
|
screenshot: 'off',
|
|
video: 'retain-on-failure',
|
|
headless: true || IS_CI,
|
|
trace: 'retain-on-failure',
|
|
permissions: ['clipboard-read', 'clipboard-write'],
|
|
extraHTTPHeaders: {
|
|
'x-vercel-protection-bypass': process.env.VERCEL_AUTOMATION_BYPASS_SELFHOSTED_STUDIO,
|
|
'x-vercel-set-bypass-cookie': 'true',
|
|
},
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'setup',
|
|
testMatch: /.*\.setup\.ts/,
|
|
},
|
|
{
|
|
name: 'Features',
|
|
testDir: './features',
|
|
testMatch: /.*\.spec\.ts/,
|
|
dependencies: ['setup'],
|
|
use: {
|
|
browserName: 'chromium',
|
|
screenshot: 'off',
|
|
// Only use storage state if authentication is enabled. When AUTHENTICATION=false
|
|
// we should not require a pre-generated storage state file.
|
|
storageState: env.AUTHENTICATION ? STORAGE_STATE_PATH : undefined,
|
|
},
|
|
},
|
|
],
|
|
reporter: [
|
|
['list'],
|
|
['html', { open: 'never' }],
|
|
['json', { outputFile: 'test-results/test-results.json' }],
|
|
],
|
|
})
|