-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
38 lines (35 loc) · 893 Bytes
/
playwright.config.js
File metadata and controls
38 lines (35 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { defineConfig, test } from '@playwright/test';
import path from 'path';
import { addAliases } from 'module-alias';
addAliases({
$lib: path.resolve(process.cwd(), 'src/lib'),
});
export const STORAGE_STATE = path.join(process.cwd(), '__playwright/.auth/user.json');
process.env.ACCOUNT_DATA = path.join(path.dirname(STORAGE_STATE), 'account_data.json');
export default defineConfig({
webServer: {
command: 'npm run env:test',
port: 4173,
},
testDir: 'src/routes',
outputDir: '__playwright',
workers: 1,
projects: [
{
name: 'public',
testMatch: /routes(?!\/\(protected\)\/)(\/.*)?\/ui-tests.js/,
},
{
name: 'protected-setup',
testMatch: /\(protected\)\/ui-tests-setup\.js/,
},
{
name: 'protected',
dependencies: ['protected-setup'],
use: {
storageState: STORAGE_STATE,
},
testMatch: /\(protected\)(\/.*)?\/ui-tests.js/,
},
]
});