File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { defineConfig , devices } from "@playwright/test"
22
3+ const JSON_REPORT = process . env . JSON_REPORT === "1"
4+ const DEV_SERVER_PORT = process . env . DEV_SERVER_PORT || 3000
5+
36/**
47 * @see https://playwright.dev/docs/test-configuration
58 */
@@ -10,9 +13,11 @@ export default defineConfig({
1013 forbidOnly : ! ! process . env . CI ,
1114 retries : process . env . CI ? 2 : 0 ,
1215 workers : process . env . CI ? 1 : undefined ,
13- reporter : "html" ,
16+ reporter : JSON_REPORT
17+ ? [ [ "list" ] , [ "json" , { outputFile : "./test/test-results.json" } ] ]
18+ : [ [ "html" ] ] ,
1419 use : {
15- baseURL : " http://localhost:3000" ,
20+ baseURL : ` http://localhost:${ DEV_SERVER_PORT } ` ,
1621 trace : "on-first-retry" ,
1722 } ,
1823
@@ -25,7 +30,7 @@ export default defineConfig({
2530
2631 webServer : {
2732 command : "pnpm dev" ,
28- url : " http://localhost:3000" ,
33+ url : ` http://localhost:${ DEV_SERVER_PORT } ` ,
2934 reuseExistingServer : ! process . env . CI ,
3035 } ,
3136} )
You can’t perform that action at this time.
0 commit comments