Skip to content

Commit ad7f481

Browse files
committed
feat: add new e2e test to test browser
1 parent 8d25ede commit ad7f481

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/e2e/browser.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference types="jest-playwright-preset" />
2+
3+
beforeAll(async () => {
4+
await page.goto("https://whatismybrowser.com/")
5+
})
6+
7+
test("should display correct browser", async () => {
8+
const browser = await page.$eval(".string-major", (el) => el.innerHTML)
9+
10+
const displayNames = {
11+
chromium: "Chrome",
12+
firefox: "Firefox",
13+
webkit: "Safari",
14+
}
15+
expect(browser).toContain(displayNames[browserName])
16+
})

0 commit comments

Comments
 (0)