feat: add new e2e test to test browser

This commit is contained in:
Joe Previte 2021-03-30 11:35:36 -07:00
parent 3db19843e2
commit 6b3db06c7a
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24

16
test/e2e/browser.test.ts Normal file
View File

@ -0,0 +1,16 @@
/// <reference types="jest-playwright-preset" />
beforeAll(async () => {
await page.goto("https://whatismybrowser.com/")
})
test("should display correct browser", async () => {
const browser = await page.$eval(".string-major", (el) => el.innerHTML)
const displayNames = {
chromium: "Chrome",
firefox: "Firefox",
webkit: "Safari",
}
expect(browser).toContain(displayNames[browserName])
})