mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
This brings an initial E2E test (really, an integration test - it's only running the server locally, as opposed to against a deployment - but it'd be easy to point playwright to a deployment). Demo gif:  This test exercises a minimal flow for login: - Run the `coderd` binary to start a server on 3000 - Create an initial user as part of setup - Go through the login flow and verify we land on the projects page It will be useful to have to ensure that #360 doesn't introduce a regression in the login flow Future E2E tests that would be useful: - Create a project & verify it shows in the UI - Create a workspace and verify it shows in the UI
28 lines
792 B
TypeScript
28 lines
792 B
TypeScript
import * as path from "path"
|
|
import { PlaywrightTestConfig } from "@playwright/test"
|
|
|
|
const config: PlaywrightTestConfig = {
|
|
testDir: "tests",
|
|
globalSetup: require.resolve("./globalSetup"),
|
|
|
|
// Create junit report file for upload to DataDog
|
|
reporter: [["junit", { outputFile: "test-results/junit.xml" }]],
|
|
|
|
use: {
|
|
baseURL: "http://localhost:3000",
|
|
video: "retain-on-failure",
|
|
},
|
|
|
|
// `webServer` tells Playwright to launch a test server - more details here:
|
|
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
|
webServer: {
|
|
// Run the 'coderd' binary directly
|
|
command: path.join(__dirname, "../../bin/coderd"),
|
|
port: 3000,
|
|
timeout: 120 * 10000,
|
|
reuseExistingServer: false,
|
|
},
|
|
}
|
|
|
|
export default config
|