Files
coder/site/e2e/globalSetup.ts
T
Kyle Carberry bf0ae8f573 feat: Refactor API routes to use UUIDs instead of friendly names (#401)
* 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
2022-03-07 11:40:54 -06:00

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