Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/test/e2e/browser.test.ts

16 lines
559 B
TypeScript
Raw Normal View History

import { test, expect } from "@playwright/test"
2021-04-14 21:03:47 +02:00
import { CODE_SERVER_ADDRESS } from "../utils/constants"
2021-03-30 20:35:36 +02:00
2021-04-14 21:03:47 +02:00
// 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 = {
chromium: "Chrome",
firefox: "Firefox",
webkit: "Safari",
}
2021-04-14 21:03:47 +02:00
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
const userAgent = await page.evaluate("navigator.userAgent")
2021-04-14 21:03:47 +02:00
expect(userAgent).toContain(displayNames[browserName])
2021-03-30 20:35:36 +02:00
})