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.
- Cross-browser — Chromium, Firefox, WebKit (Safari) from a single test
- Type-safe — strict TypeScript, full IntelliSense
- Auto-download — installs browsers on demand
- Built-in assertions —
expectTitle(),expectVisible(),expectText() - Visual regression — screenshot capture and pixel comparison
- CI-ready — headless by default, works in Docker
| Browser | Engine | Status |
|---|---|---|
| Chrome | Chromium | ✔ Supported |
| Edge | Chromium | ✔ Supported |
| Firefox | Firefox | ✔ Supported |
| Safari | WebKit | ✔ Supported |
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 runOutput:
✓ My App [chromium] > loads homepage
✓ My App [firefox] > loads homepage
✓ My App [webkit] > loads homepage
npm install unibrowser
npx playwright install chromium firefox webkitOr install programmatically:
import { ensureAll } from "unibrowser";
ensureAll(); // downloads browsers + system deps- UniBrowser — launch, close, browser management
- UniPage — navigation, locators, interactions
- UniElement — element queries, assertions
- UniContext — cookies, routes, permissions
- Browser Manager — install, status, platform info
- Cross-Browser Testing — one test, all browsers
- Assertions — built-in expect helpers
- Screenshots — capture and visual regression
- Network — request interception, offline mode
- CI/CD — GitHub Actions, GitLab, Docker
- Types — all TypeScript interfaces
- Configuration — defaults, overrides
- Utilities — wait, retry, logger
- Pyright — Python type interop