code-server/test/e2e/browser.test.ts

24 lines
682 B
TypeScript
Raw Normal View History

import { test, expect } from "@playwright/test"
import { CodeServer } from "./models/CodeServer"
2021-03-31 02:35:36 +08:00
2021-04-15 03:03:47 +08:00
// This is a "gut-check" test to make sure playwright is working as expected
test.describe("browser", () => {
let codeServer: CodeServer
test.beforeEach(async ({ page }) => {
codeServer = new CodeServer(page)
await codeServer.navigate()
})
test("browser should display correct userAgent", async ({ page, browserName }) => {
const displayNames = {
chromium: "Chrome",
firefox: "Firefox",
webkit: "Safari",
}
const userAgent = await page.evaluate("navigator.userAgent")
expect(userAgent).toContain(displayNames[browserName])
})
2021-03-31 02:35:36 +08:00
})