advanced-ads
Last commit date
admin
3 weeks ago
assets
3 weeks ago
classes
3 weeks ago
deprecated
3 weeks ago
includes
3 weeks ago
languages
3 weeks ago
modules
3 weeks ago
packages
3 weeks ago
public
3 weeks ago
src
3 weeks ago
upgrades
3 weeks ago
views
3 weeks ago
CLAUDE.md
2 months ago
LICENSE.txt
12 years ago
advanced-ads.php
3 weeks ago
dev.config.example.json
1 month ago
index.php
2 years ago
playwright.config.ts
3 weeks ago
postcss.config.js
10 months ago
readme.txt
3 weeks ago
webpack.config.js
1 month ago
wpml-config.xml
5 months ago
playwright.config.ts
97 lines
| 1 | import fs from 'node:fs'; |
| 2 | import path from 'node:path'; |
| 3 | import { defineConfig } from '@playwright/test'; |
| 4 | |
| 5 | // Load external config file. |
| 6 | let externalConfig = {}; |
| 7 | const jsonPath = path.resolve( './dev.config.json' ); |
| 8 | |
| 9 | if ( fs.existsSync( jsonPath ) ) { |
| 10 | externalConfig = JSON.parse( fs.readFileSync( jsonPath, 'utf8' ) ); |
| 11 | } |
| 12 | |
| 13 | export default defineConfig( { |
| 14 | name: 'Advanced Ads', |
| 15 | testDir: 'tests/Acceptance', |
| 16 | use: { |
| 17 | baseURL: 'http://localhost:8888', |
| 18 | browserName: 'chromium', |
| 19 | ...externalConfig.use, |
| 20 | }, |
| 21 | reporter: 'html', |
| 22 | projects: [ |
| 23 | // ---------------------------------------------------- |
| 24 | // Setup project (creates auth.json for wp-admin login) |
| 25 | // ---------------------------------------------------- |
| 26 | { |
| 27 | name: 'setup', |
| 28 | testMatch: 'tests/Acceptance/Fixtures/auth.setup.ts', |
| 29 | }, |
| 30 | |
| 31 | // ---------------------------------------------------- |
| 32 | // Backend (wp-admin) tests |
| 33 | // ---------------------------------------------------- |
| 34 | { |
| 35 | name: 'admin', |
| 36 | testDir: 'tests/Acceptance/Admin', |
| 37 | use: { storageState: 'auth.json' }, |
| 38 | dependencies: [ 'setup' ], |
| 39 | testIgnore: [ '**/Licenses/**', '**/Ads/**', '**/Groups/**', '**/Placements/**', '**/Support/**' ], |
| 40 | }, |
| 41 | |
| 42 | { |
| 43 | name: 'admin-ads', |
| 44 | testDir: 'tests/Acceptance/Admin/Ads', |
| 45 | use: { storageState: 'auth.json' }, |
| 46 | dependencies: [ 'setup' ], |
| 47 | }, |
| 48 | |
| 49 | { |
| 50 | name: 'admin-groups', |
| 51 | testDir: 'tests/Acceptance/Admin/Groups', |
| 52 | use: { storageState: 'auth.json' }, |
| 53 | dependencies: [ 'admin-ads' ], |
| 54 | fullyParallel: false, |
| 55 | }, |
| 56 | |
| 57 | { |
| 58 | name: 'admin-placements', |
| 59 | testDir: 'tests/Acceptance/Admin/Placements', |
| 60 | use: { storageState: 'auth.json' }, |
| 61 | dependencies: [ 'admin-groups' ], |
| 62 | fullyParallel: false, |
| 63 | workers: 1, |
| 64 | }, |
| 65 | |
| 66 | { |
| 67 | name: 'admin-licenses', |
| 68 | testDir: 'tests/Acceptance/Admin/Licenses', |
| 69 | use: { storageState: 'auth.json' }, |
| 70 | dependencies: [ 'setup' ], |
| 71 | }, |
| 72 | |
| 73 | { |
| 74 | name: 'admin-support', |
| 75 | testDir: 'tests/Acceptance/Admin/Support', |
| 76 | use: { storageState: 'auth.json' }, |
| 77 | dependencies: [ 'setup' ], |
| 78 | }, |
| 79 | |
| 80 | // ---------------------------------------------------- |
| 81 | // Frontend tests |
| 82 | // ---------------------------------------------------- |
| 83 | { |
| 84 | name: 'frontend', |
| 85 | testDir: 'tests/Acceptance/Frontend', |
| 86 | use: { storageState: 'auth.json' }, |
| 87 | dependencies: [ 'setup' ], |
| 88 | }, |
| 89 | { |
| 90 | name: 'frontend-auth', |
| 91 | testDir: 'tests/Acceptance/Frontend/Auth', |
| 92 | use: { storageState: 'auth.json' }, |
| 93 | dependencies: [ 'setup' ], |
| 94 | }, |
| 95 | ], |
| 96 | } ); |
| 97 |