advanced-ads
Last commit date
admin
2 months ago
assets
2 months ago
classes
3 months ago
deprecated
1 year ago
includes
2 months ago
languages
2 months ago
modules
3 months ago
packages
2 months ago
public
3 months ago
src
2 months ago
upgrades
1 year ago
views
3 months ago
LICENSE.txt
12 years ago
advanced-ads.php
2 months ago
dev.config.example.json
3 months ago
index.php
2 years ago
playwright.config.ts
3 months ago
postcss.config.js
8 months ago
readme.txt
2 months ago
webpack.config.js
3 months ago
wpml-config.xml
3 months ago
playwright.config.ts
78 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 | }, |
| 40 | |
| 41 | { |
| 42 | name: 'admin-ads', |
| 43 | testDir: 'tests/Acceptance/Admin/Ads', |
| 44 | use: { storageState: 'auth.json' }, |
| 45 | dependencies: [ 'setup' ], |
| 46 | }, |
| 47 | |
| 48 | { |
| 49 | name: 'admin-groups', |
| 50 | testDir: 'tests/Acceptance/Admin/Groups', |
| 51 | use: { storageState: 'auth.json' }, |
| 52 | dependencies: [ 'admin-ads' ], |
| 53 | }, |
| 54 | |
| 55 | { |
| 56 | name: 'admin-placements', |
| 57 | testDir: 'tests/Acceptance/Admin/Placements', |
| 58 | use: { storageState: 'auth.json' }, |
| 59 | dependencies: [ 'admin-groups' ], |
| 60 | }, |
| 61 | |
| 62 | // ---------------------------------------------------- |
| 63 | // Frontend tests |
| 64 | // ---------------------------------------------------- |
| 65 | { |
| 66 | name: 'frontend', |
| 67 | testDir: 'tests/Acceptance/Frontend', |
| 68 | use: { storageState: 'auth.json' }, |
| 69 | }, |
| 70 | { |
| 71 | name: 'frontend-auth', |
| 72 | testDir: 'tests/Acceptance/Frontend/Auth', |
| 73 | use: { storageState: 'auth.json' }, |
| 74 | dependencies: [ 'setup' ], |
| 75 | }, |
| 76 | ], |
| 77 | } ); |
| 78 |