advanced-ads
Last commit date
admin
1 day ago
assets
1 day ago
classes
1 day ago
deprecated
1 week ago
docs
1 day ago
graphify-out
1 day ago
includes
1 day ago
languages
1 day ago
modules
1 day ago
packages
1 day ago
public
1 day ago
src
1 day ago
upgrades
1 day ago
views
1 day ago
CLAUDE.md
1 month ago
LICENSE.txt
12 years ago
advanced-ads.php
1 day ago
dev.config.example.json
1 day ago
index.php
2 years ago
playwright.config.ts
1 day ago
postcss.config.js
8 months ago
readme.txt
1 day ago
webpack.config.js
1 day ago
wpml-config.xml
3 months ago
playwright.config.ts
94 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/**', |
| 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 | }, |
| 55 | |
| 56 | { |
| 57 | name: 'admin-placements', |
| 58 | testDir: 'tests/Acceptance/Admin/Placements', |
| 59 | use: { storageState: 'auth.json' }, |
| 60 | dependencies: [ 'admin-groups' ], |
| 61 | }, |
| 62 | |
| 63 | { |
| 64 | name: 'admin-licenses', |
| 65 | testDir: 'tests/Acceptance/Admin/Licenses', |
| 66 | use: { storageState: 'auth.json' }, |
| 67 | dependencies: [ 'setup' ], |
| 68 | }, |
| 69 | |
| 70 | { |
| 71 | name: 'admin-support', |
| 72 | testDir: 'tests/Acceptance/Admin/Support', |
| 73 | use: { storageState: 'auth.json' }, |
| 74 | dependencies: [ 'setup' ], |
| 75 | }, |
| 76 | |
| 77 | // ---------------------------------------------------- |
| 78 | // Frontend tests |
| 79 | // ---------------------------------------------------- |
| 80 | { |
| 81 | name: 'frontend', |
| 82 | testDir: 'tests/Acceptance/Frontend', |
| 83 | use: { storageState: 'auth.json' }, |
| 84 | dependencies: [ 'setup' ], |
| 85 | }, |
| 86 | { |
| 87 | name: 'frontend-auth', |
| 88 | testDir: 'tests/Acceptance/Frontend/Auth', |
| 89 | use: { storageState: 'auth.json' }, |
| 90 | dependencies: [ 'setup' ], |
| 91 | }, |
| 92 | ], |
| 93 | } ); |
| 94 |