mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
chore: turn e2e tests back on with fixes (#5719)
* Improvement - wip * Cut out extra waits, increase timeouts * Fix timeout syntax * Extend timeouts for safety * Turn e2e back on * Format
This commit is contained in:
@@ -575,7 +575,7 @@ jobs:
|
||||
name: "test/e2e/${{ matrix.os }}"
|
||||
needs:
|
||||
- changes
|
||||
if: false #needs.changes.outputs.docs-only == 'false'
|
||||
if: needs.changes.outputs.docs-only == 'false'
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { test } from "@playwright/test"
|
||||
import { test, expect } from "@playwright/test"
|
||||
import { email, password } from "../constants"
|
||||
import { SignInPage } from "../pom"
|
||||
import { clickButton, buttons, fillInput } from "../helpers"
|
||||
import dayjs from "dayjs"
|
||||
|
||||
test("Basic flow", async ({ baseURL, page }) => {
|
||||
// We're keeping entire flows in one test, which means the test needs extra time.
|
||||
test.setTimeout(120000)
|
||||
test.setTimeout(5 * 60 * 1000)
|
||||
await page.goto(baseURL + "/", { waitUntil: "networkidle" })
|
||||
|
||||
// Log-in with the default credentials we set up in the development server
|
||||
@@ -13,7 +14,6 @@ test("Basic flow", async ({ 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)
|
||||
@@ -27,15 +27,22 @@ test("Basic flow", async ({ baseURL, page }) => {
|
||||
// create workspace
|
||||
await clickButton(page, buttons.createWorkspace)
|
||||
|
||||
await fillInput(page, "Workspace Name", "my-workspace")
|
||||
// give workspace a unique name to avoid failure
|
||||
await fillInput(
|
||||
page,
|
||||
"Workspace Name",
|
||||
`workspace-${dayjs().format("MM-DD-hh-mm-ss")}`,
|
||||
)
|
||||
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")
|
||||
const stopButton = page.getByRole("button", {
|
||||
name: buttons.stopWorkspace,
|
||||
exact: true,
|
||||
})
|
||||
await expect(stopButton).toBeEnabled({ timeout: 60_000 })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user