File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ // Our base port. It's important to run on 3000,
2
+ // which matches our api server
3
+ export const basePort = 3000
4
+
1
5
// Credentials for the default user when running in dev mode.
2
6
export const username = "developer"
3
7
export const password = "password"
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { postFirstUser } from "../src/api/api"
3
3
import * as constants from "./constants"
4
4
5
5
const globalSetup = async ( ) : Promise < void > => {
6
- axios . defaults . baseURL = " http://localhost:3000"
6
+ axios . defaults . baseURL = ` http://localhost:${ constants . basePort } `
7
7
await postFirstUser ( {
8
8
email : constants . email ,
9
9
organization : constants . organization ,
Original file line number Diff line number Diff line change 1
1
import { PlaywrightTestConfig } from "@playwright/test"
2
2
import * as path from "path"
3
+ import { basePort } from "./constants"
3
4
4
5
const config : PlaywrightTestConfig = {
5
6
testDir : "tests" ,
@@ -8,8 +9,11 @@ const config: PlaywrightTestConfig = {
8
9
// Create junit report file for upload to DataDog
9
10
reporter : [ [ "junit" , { outputFile : "test-results/junit.xml" } ] ] ,
10
11
12
+ // NOTE: if Playwright complains about the port being taken
13
+ // do not change the basePort (it must match our api server).
14
+ // Instead, simply run the test suite without running our local server.
11
15
use : {
12
- baseURL : " http://localhost:3000" ,
16
+ baseURL : ` http://localhost:${ basePort } ` ,
13
17
video : "retain-on-failure" ,
14
18
} ,
15
19
@@ -21,7 +25,7 @@ const config: PlaywrightTestConfig = {
21
25
__dirname ,
22
26
"../../cmd/coder/main.go" ,
23
27
) } server --in-memory`,
24
- port : 3000 ,
28
+ port : basePort ,
25
29
timeout : 120 * 10000 ,
26
30
reuseExistingServer : false ,
27
31
} ,
You can’t perform that action at this time.
0 commit comments