Skip to content

Commit 4abbf79

Browse files
committed
fix: update path for e2e videos
1 parent ef52f6c commit 4abbf79

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

.github/workflows/ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,11 @@ jobs:
350350
if: always()
351351
uses: actions/upload-artifact@v2
352352
with:
353-
name: test-videos
354-
path: ./test/e2e/videos
353+
name: failed-test-videos
354+
path: ./test/test-results
355355

356356
- name: Remove release packages and test artifacts
357-
run: rm -rf ./release-packages ./test/e2e/videos
357+
run: rm -rf ./release-packages ./test/test-results
358358

359359
docker-amd64:
360360
runs-on: ubuntu-latest

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ node-*
1616
.home
1717
coverage
1818
**/.DS_Store
19-
test/e2e/videos
20-
test/e2e/screenshots
19+
# Failed e2e test videos are saved here
20+
test/test-results

test/config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ globalSetup(async () => {
5151
const config: Config = {
5252
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
5353
timeout: 30000, // Each test is given 30 seconds.
54-
retries: 2, // Retry failing tests 2 times
54+
retries: 3, // Retry failing tests 2 times
55+
}
56+
57+
if (process.env.CI) {
58+
config.retries = 2
5559
}
5660

5761
setConfig(config)

test/e2e/browser.test.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
import { test, expect } from "@playwright/test"
2+
import { CODE_SERVER_ADDRESS } from "../utils/constants"
23

3-
test("should display correct browser based on userAgent", async ({ page, browserName }) => {
4+
// This is a "gut-check" test to make sure playwright is working as expected
5+
test("browser should display correct userAgent", async ({ page, browserName }) => {
46
const displayNames = {
57
chromium: "Chrome",
68
firefox: "Firefox",
79
webkit: "Safari",
810
}
11+
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
912
const userAgent = await page.evaluate("navigator.userAgent")
1013

11-
if (browserName === "chromium") {
12-
expect(userAgent).toContain(displayNames[browserName])
13-
}
14-
15-
if (browserName === "firefox") {
16-
expect(userAgent).toContain(displayNames[browserName])
17-
}
18-
19-
if (browserName === "webkit") {
20-
expect(userAgent).toContain(displayNames[browserName])
21-
}
14+
expect(userAgent).toContain(displayNames[browserName])
2215
})

0 commit comments

Comments
 (0)