API ReferenceTypeScriptVitest
Vitest
@allwright.dev/vitest layers Playwright-style test fixtures and retrying, negatable assertions on top of @allwright.dev/core, so a spec file never touches launch/config plumbing directly.
test
A Vitest test extended with lazy page/browser/android/androidApp fixtures — nothing launches or connects until a fixture's method is first awaited.
test(name: string, fn: (ctx: { page: Page; browser: Browser; android: MobileAndroidDevice; androidApp: MobileAndroidApp }) => Promise<void>): voidExample
import { expect, test } from "@allwright.dev/vitest";
test("opens a page", async ({ page }) => {
await page.goto("https://themoderninternet.vercel.app");
});expect
Vitest's expect, augmented: called with a Page/Locator (web or Android) it returns retrying matchers — toHaveText, toContainText, toHaveCount, toBeVisible — instead of the plain-value assertions it returns for anything else.
expect(actual: Page | MobileAndroidApp): PageExpectMatchers
expect(actual: Locator | MobileAndroidLocator): LocatorExpectMatchersNegated assertions
Every matcher supports both the property form .not and the callable form .not() — matchers are immutable, so a second .not toggles back to positive.
expect(locator).not.toHaveText(expected)
expect(locator).not().toBeVisible()Example
await expect(page.getByTestId('spinner')).not().toBeVisible();
await expect(page).not.toHaveCount('.error', 1);allwrightVitestConfig
Wraps a Vitest config to start the allwright engine once before the whole run and shut it down once after, instead of every test bootstrapping its own.
function allwrightVitestConfig<T extends UserConfig>(config: T): TExample
import { allwrightVitestConfig } from "@allwright.dev/vitest/config";
export default allwrightVitestConfig(defineConfig({ test: {} }));