From 6b3db06c7aa029d0c1155e24c2e43a0bc34c8074 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 30 Mar 2021 11:35:36 -0700 Subject: [PATCH] feat: add new e2e test to test browser --- test/e2e/browser.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/e2e/browser.test.ts diff --git a/test/e2e/browser.test.ts b/test/e2e/browser.test.ts new file mode 100644 index 000000000..0801c9e95 --- /dev/null +++ b/test/e2e/browser.test.ts @@ -0,0 +1,16 @@ +/// + +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]) +})