feat: add new e2e test to test browser
This commit is contained in:
parent
3db19843e2
commit
6b3db06c7a
16
test/e2e/browser.test.ts
Normal file
16
test/e2e/browser.test.ts
Normal 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])
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user