mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: adding some quality of life Playwright comments (#2726)
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
// Our base port. It's important to run on 3000,
|
||||
// which matches our api server
|
||||
export const basePort = 3000
|
||||
|
||||
// Credentials for the default user when running in dev mode.
|
||||
export const username = "developer"
|
||||
export const password = "password"
|
||||
|
||||
@@ -3,7 +3,7 @@ import { postFirstUser } from "../src/api/api"
|
||||
import * as constants from "./constants"
|
||||
|
||||
const globalSetup = async (): Promise<void> => {
|
||||
axios.defaults.baseURL = "http://localhost:3000"
|
||||
axios.defaults.baseURL = `http://localhost:${constants.basePort}`
|
||||
await postFirstUser({
|
||||
email: constants.email,
|
||||
organization: constants.organization,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { PlaywrightTestConfig } from "@playwright/test"
|
||||
import * as path from "path"
|
||||
import { basePort } from "./constants"
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
testDir: "tests",
|
||||
@@ -8,8 +9,11 @@ const config: PlaywrightTestConfig = {
|
||||
// Create junit report file for upload to DataDog
|
||||
reporter: [["junit", { outputFile: "test-results/junit.xml" }]],
|
||||
|
||||
// NOTE: if Playwright complains about the port being taken
|
||||
// do not change the basePort (it must match our api server).
|
||||
// Instead, simply run the test suite without running our local server.
|
||||
use: {
|
||||
baseURL: "http://localhost:3000",
|
||||
baseURL: `http://localhost:${basePort}`,
|
||||
video: "retain-on-failure",
|
||||
},
|
||||
|
||||
@@ -21,7 +25,7 @@ const config: PlaywrightTestConfig = {
|
||||
__dirname,
|
||||
"../../cmd/coder/main.go",
|
||||
)} server --in-memory`,
|
||||
port: 3000,
|
||||
port: basePort,
|
||||
timeout: 120 * 10000,
|
||||
reuseExistingServer: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user