Files
coder/site/e2e/tests/basicFlow.spec.ts
T
Presley Pizzo 627fbe5874 fix: make build table show empty instead of loading when none are recent (#5666)
* Fix builds to show empty instead of loading

* Switch to backend fix

* Increase e2e test timeout

* Format
2023-01-11 12:18:06 -05:00

42 lines
1.4 KiB
TypeScript

import { test } from "@playwright/test"
import { email, password } from "../constants"
import { SignInPage } from "../pom"
import { clickButton, buttons, fillInput } from "../helpers"
test("Basic flow", async ({ baseURL, page }) => {
// We're keeping entire flows in one test, which means the test needs extra time.
test.setTimeout(120000)
await page.goto(baseURL + "/", { waitUntil: "networkidle" })
// Log-in with the default credentials we set up in the development server
const signInPage = new SignInPage(baseURL, page)
await signInPage.submitBuiltInAuthentication(email, password)
// create Docker template
await page.waitForSelector("text=Templates")
await page.click("text=Templates")
await clickButton(page, buttons.starterTemplates)
await page.click(`text=${buttons.dockerTemplate}`)
await clickButton(page, buttons.useTemplate)
await clickButton(page, buttons.createTemplate)
// create workspace
await clickButton(page, buttons.createWorkspace)
await fillInput(page, "Workspace Name", "my-workspace")
await clickButton(page, buttons.submitCreateWorkspace)
// stop workspace
await page.waitForSelector("text=Started")
await clickButton(page, buttons.stopWorkspace)
// start workspace
await page.waitForSelector("text=Stopped")
await clickButton(page, buttons.startWorkspace)
await page.waitForSelector("text=Started")
})