Files
coder/site/e2e/helpers.ts
T
Presley PizzoandBen Potter 56a69b7eea chore: add e2e tests for basic template and workspace flow (#5637)
* Fix type error in first user setup

* Save auth state

* Add template creation - wip

Remove saved auth state because it wasn't working

* Try adding the rest of the tests

Can't see if they work yet, waiting on a release

* Update playwright

* Update gitignore

* Write tests

* Format

* Update ignores

* Check that start worked

Co-authored-by: Ben Potter <ben@coder.com>

Co-authored-by: Ben Potter <ben@coder.com>
2023-01-10 12:30:44 -05:00

25 lines
647 B
TypeScript

import { Page } from "@playwright/test"
export const buttons = {
starterTemplates: "Starter templates",
dockerTemplate: "Develop in Docker",
useTemplate: "Use template",
createTemplate: "Create template",
createWorkspace: "Create workspace",
submitCreateWorkspace: "Create workspace",
stopWorkspace: "Stop",
startWorkspace: "Start",
}
export const clickButton = async (page: Page, name: string): Promise<void> => {
await page.getByRole("button", { name, exact: true }).click()
}
export const fillInput = async (
page: Page,
label: string,
value: string,
): Promise<void> => {
await page.fill(`text=${label}`, value)
}