diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 055ea4f896..e51dc464e8 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -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: diff --git a/site/e2e/tests/basicFlow.spec.ts b/site/e2e/tests/basicFlow.spec.ts index 402f897353..95fc6817cb 100644 --- a/site/e2e/tests/basicFlow.spec.ts +++ b/site/e2e/tests/basicFlow.spec.ts @@ -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 }) })