mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
* Add client for agent * Cleanup code * Fix linting error * Rename routes to be simpler * Rename workspace history to workspace build * Refactor HTTP middlewares to use UUIDs * Cleanup routes * Compiles! * Fix files and organizations * Fix querying * Fix agent lock * Cleanup database abstraction * Add parameters * Fix linting errors * Fix log race * Lock on close wait * Fix log cleanup * Fix e2e tests * Fix upstream version of opencensus-go * Update coderdtest.go * Fix coverpkg * Fix codecov ignore
25 lines
600 B
TypeScript
25 lines
600 B
TypeScript
import { FullConfig, request } from "@playwright/test"
|
|
import { email, username, password, organization } from "./constants"
|
|
|
|
const globalSetup = async (config: FullConfig): Promise<void> => {
|
|
// Grab the 'baseURL' from the webserver (`coderd`)
|
|
const { baseURL } = config.projects[0].use
|
|
|
|
// Create a context that will issue http requests.
|
|
const context = await request.newContext({
|
|
baseURL,
|
|
})
|
|
|
|
// Create initial user
|
|
await context.post("/api/v2/users/first", {
|
|
data: {
|
|
email,
|
|
username,
|
|
password,
|
|
organization,
|
|
},
|
|
})
|
|
}
|
|
|
|
export default globalSetup
|