fix: update path for e2e videos
This commit is contained in:
parent
c9fa931a0b
commit
d6f0725399
|
@ -350,11 +350,11 @@ jobs:
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: test-videos
|
name: failed-test-videos
|
||||||
path: ./test/e2e/videos
|
path: ./test/test-results
|
||||||
|
|
||||||
- name: Remove release packages and test artifacts
|
- name: Remove release packages and test artifacts
|
||||||
run: rm -rf ./release-packages ./test/e2e/videos
|
run: rm -rf ./release-packages ./test/test-results
|
||||||
|
|
||||||
docker-amd64:
|
docker-amd64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -16,5 +16,5 @@ node-*
|
||||||
.home
|
.home
|
||||||
coverage
|
coverage
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
test/e2e/videos
|
# Failed e2e test videos are saved here
|
||||||
test/e2e/screenshots
|
test/test-results
|
||||||
|
|
|
@ -51,7 +51,11 @@ globalSetup(async () => {
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
|
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
|
||||||
timeout: 30000, // Each test is given 30 seconds.
|
timeout: 30000, // Each test is given 30 seconds.
|
||||||
retries: 2, // Retry failing tests 2 times
|
retries: 3, // Retry failing tests 2 times
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.CI) {
|
||||||
|
config.retries = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
setConfig(config)
|
setConfig(config)
|
||||||
|
|
|
@ -1,22 +1,15 @@
|
||||||
import { test, expect } from "@playwright/test"
|
import { test, expect } from "@playwright/test"
|
||||||
|
import { CODE_SERVER_ADDRESS } from "../utils/constants"
|
||||||
|
|
||||||
test("should display correct browser based on userAgent", async ({ page, browserName }) => {
|
// This is a "gut-check" test to make sure playwright is working as expected
|
||||||
|
test("browser should display correct userAgent", async ({ page, browserName }) => {
|
||||||
const displayNames = {
|
const displayNames = {
|
||||||
chromium: "Chrome",
|
chromium: "Chrome",
|
||||||
firefox: "Firefox",
|
firefox: "Firefox",
|
||||||
webkit: "Safari",
|
webkit: "Safari",
|
||||||
}
|
}
|
||||||
|
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
||||||
const userAgent = await page.evaluate("navigator.userAgent")
|
const userAgent = await page.evaluate("navigator.userAgent")
|
||||||
|
|
||||||
if (browserName === "chromium") {
|
|
||||||
expect(userAgent).toContain(displayNames[browserName])
|
expect(userAgent).toContain(displayNames[browserName])
|
||||||
}
|
|
||||||
|
|
||||||
if (browserName === "firefox") {
|
|
||||||
expect(userAgent).toContain(displayNames[browserName])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (browserName === "webkit") {
|
|
||||||
expect(userAgent).toContain(displayNames[browserName])
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue