2021-04-13 22:02:52 +03:00
|
|
|
import { test, expect } from "@playwright/test"
|
2021-04-22 00:31:15 +03:00
|
|
|
import { CodeServer } from "./models/CodeServer"
|
2021-03-30 21:35:36 +03:00
|
|
|
|
2021-04-14 22:03:47 +03:00
|
|
|
// This is a "gut-check" test to make sure playwright is working as expected
|
2021-04-22 00:31:15 +03:00
|
|
|
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-30 21:35:36 +03:00
|
|
|
})
|