2021-04-14 02:02:52 +07:00
|
|
|
import { test, expect } from "@playwright/test"
|
2021-04-15 02:03:47 +07:00
|
|
|
import { CODE_SERVER_ADDRESS } from "../utils/constants"
|
2021-03-31 01:35:36 +07:00
|
|
|
|
2021-04-15 02:03:47 +07:00
|
|
|
// This is a "gut-check" test to make sure playwright is working as expected
|
|
|
|
test("browser should display correct userAgent", async ({ page, browserName }) => {
|
2021-04-14 02:02:52 +07:00
|
|
|
const displayNames = {
|
|
|
|
chromium: "Chrome",
|
|
|
|
firefox: "Firefox",
|
|
|
|
webkit: "Safari",
|
|
|
|
}
|
2021-04-15 02:03:47 +07:00
|
|
|
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
|
2021-04-14 02:02:52 +07:00
|
|
|
const userAgent = await page.evaluate("navigator.userAgent")
|
2021-03-31 02:24:51 +07:00
|
|
|
|
2021-04-15 02:03:47 +07:00
|
|
|
expect(userAgent).toContain(displayNames[browserName])
|
2021-03-31 01:35:36 +07:00
|
|
|
})
|