FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cortext/playwright.config.js at main · Automattic/cortext · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Automattic
/
cortext
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
47
Code
Issues
49
Pull requests
7
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cortext
/
playwright.config.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (37 loc) · 1.15 KB
Breadcrumbs
cortext
/
playwright.config.js
Copy path
File metadata and controls
41 lines (37 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
39
40
41
/**
* Playwright config for Cortext e2e tests.
*
* Extends the @wordpress/scripts default config. Resolves WP_BASE_URL from:
* 1. env var (CI sets this explicitly)
* 2. .wp-env.override.json port (per-worktree local dev)
* 3. wp-env default 8889 (Playground has no separate tests env)
*/
// Resolve before requiring the base config, which reads WP_BASE_URL at load time.
function
resolveBaseURL
(
)
{
if
(
process
.
env
.
WP_BASE_URL
)
{
return
process
.
env
.
WP_BASE_URL
;
}
try
{
const
override
=
require
(
'./.wp-env.override.json'
)
;
if
(
override
.
port
)
{
return
`http://localhost:
${
override
.
port
}
`
;
}
}
catch
{
// File is gitignored; absent on CI.
}
return
'http://localhost:8889'
;
}
process
.
env
.
WP_BASE_URL
=
resolveBaseURL
(
)
;
const
{
defineConfig
}
=
require
(
'@playwright/test'
)
;
const
baseConfig
=
require
(
'@wordpress/scripts/config/playwright.config.js'
)
;
module
.
exports
=
defineConfig
(
{
...
baseConfig
,
testDir
:
'./tests/e2e/specs'
,
globalSetup
:
require
.
resolve
(
'./tests/e2e/global-setup.js'
)
,
// wp-env is started explicitly by the developer / CI.
webServer
:
undefined
,
use
:
{
...
baseConfig
.
use
,
video
:
'off'
,
}
,
}
)
;
Back
|
FazBrowse Home
|
New Git URL