2021-03-30 18:35:36 +00:00
|
|
|
/// <reference types="jest-playwright-preset" />
|
|
|
|
|
2021-03-30 19:24:51 +00:00
|
|
|
// This test is for nothing more than to make sure
|
|
|
|
// tests are running in multiple browsers
|
|
|
|
describe("Browser gutcheck", () => {
|
|
|
|
beforeEach(async () => {
|
|
|
|
await jestPlaywright.resetBrowser()
|
|
|
|
})
|
|
|
|
|
|
|
|
test("should display correct browser", async () => {
|
|
|
|
const displayNames = {
|
|
|
|
chromium: "Chrome",
|
|
|
|
firefox: "Firefox",
|
|
|
|
webkit: "Safari",
|
|
|
|
}
|
|
|
|
const userAgent = await page.evaluate("navigator.userAgent")
|
2021-03-30 18:35:36 +00:00
|
|
|
|
2021-03-30 19:24:51 +00:00
|
|
|
if (browserName === "firefox") {
|
|
|
|
expect(userAgent).toContain(displayNames[browserName])
|
|
|
|
}
|
2021-03-30 18:35:36 +00:00
|
|
|
|
2021-03-30 19:24:51 +00:00
|
|
|
if (browserName === "chromium") {
|
|
|
|
expect(userAgent).toContain(displayNames[browserName])
|
|
|
|
}
|
|
|
|
})
|
2021-03-30 18:35:36 +00:00
|
|
|
})
|