Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63956ea

Browse files
authored
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
1 parent 7f5dcc3 commit 63956ea

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/coder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ jobs:
575575
name: "test/e2e/${{ matrix.os }}"
576576
needs:
577577
- changes
578-
if: false #needs.changes.outputs.docs-only == 'false'
578+
if: needs.changes.outputs.docs-only == 'false'
579579
runs-on: ${{ matrix.os }}
580580
timeout-minutes: 20
581581
strategy:

site/e2e/tests/basicFlow.spec.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { test } from "@playwright/test"
1+
import { test, expect } from "@playwright/test"
22
import { email, password } from "../constants"
33
import { SignInPage } from "../pom"
44
import { clickButton, buttons, fillInput } from "../helpers"
5+
import dayjs from "dayjs"
56

67
test("Basic flow", async ({ baseURL, page }) => {
78
// We're keeping entire flows in one test, which means the test needs extra time.
8-
test.setTimeout(120000)
9+
test.setTimeout(5 * 60 * 1000)
910
await page.goto(baseURL + "/", { waitUntil: "networkidle" })
1011

1112
// Log-in with the default credentials we set up in the development server
1213
const signInPage = new SignInPage(baseURL, page)
1314
await signInPage.submitBuiltInAuthentication(email, password)
1415

1516
// create Docker template
16-
await page.waitForSelector("text=Templates")
1717
await page.click("text=Templates")
1818

1919
await clickButton(page, buttons.starterTemplates)
@@ -27,15 +27,22 @@ test("Basic flow", async ({ baseURL, page }) => {
2727
// create workspace
2828
await clickButton(page, buttons.createWorkspace)
2929

30-
await fillInput(page, "Workspace Name", "my-workspace")
30+
// give workspace a unique name to avoid failure
31+
await fillInput(
32+
page,
33+
"Workspace Name",
34+
`workspace-${dayjs().format("MM-DD-hh-mm-ss")}`,
35+
)
3136
await clickButton(page, buttons.submitCreateWorkspace)
3237

3338
// stop workspace
34-
await page.waitForSelector("text=Started")
3539
await clickButton(page, buttons.stopWorkspace)
3640

3741
// start workspace
38-
await page.waitForSelector("text=Stopped")
3942
await clickButton(page, buttons.startWorkspace)
40-
await page.waitForSelector("text=Started")
43+
const stopButton = page.getByRole("button", {
44+
name: buttons.stopWorkspace,
45+
exact: true,
46+
})
47+
await expect(stopButton).toBeEnabled({ timeout: 60_000 })
4148
})

0 commit comments

Comments
 (0)