Skip to content

TheForgivenOne/unibrowser

Repository files navigation

unibrowser

Write one test. Run it across Chrome, Firefox, and Safari.

unibrowser is a headless cross-browser E2E testing package for TypeScript. It wraps Playwright with a simpler, fully-typed API and runs your tests across Chromium, Firefox, and WebKit (Safari) automatically.

Features

  • Cross-browser — Chromium, Firefox, WebKit (Safari) from a single test
  • Type-safe — strict TypeScript, full IntelliSense
  • Auto-download — installs browsers on demand
  • Built-in assertionsexpectTitle(), expectVisible(), expectText()
  • Visual regression — screenshot capture and pixel comparison
  • CI-ready — headless by default, works in Docker

Supported Browsers

Browser Engine Status
Chrome Chromium ✔ Supported
Edge Chromium ✔ Supported
Firefox Firefox ✔ Supported
Safari WebKit ✔ Supported

Quick Example

import { expect } from "vitest";
import { crossBrowserSuite } from "unibrowser";

crossBrowserSuite("My App", (test) => {
  test("loads homepage", async ({ page }) => {
    await page.goto("https://example.com");
    await page.expectTitle("Example Domain");
    const h1 = page.locator("h1");
    await h1.expectText("Example Domain");
  });
});

Run it:

npx vitest run

Output:

✓ My App [chromium] > loads homepage
✓ My App [firefox]  > loads homepage
✓ My App [webkit]   > loads homepage

Installation

npm install unibrowser
npx playwright install chromium firefox webkit

Or install programmatically:

import { ensureAll } from "unibrowser";
ensureAll(); // downloads browsers + system deps

Documentation

Getting Started

API Reference

Guides

Reference

About

Headless cross-browser E2E testing with full type safety | Docs: https://theforgivenone.github.io/unibrowser/

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages