Skip to main content
Use @qawolf/flows/web for browser flows and Electron flows.

Browser Flow

Start here for ordinary web app tests.
import { expect, flow } from "@qawolf/flows/web";

export default flow(
  "Search docs",
  { target: "Web - Chrome", launch: true },
  async ({ page }) => {
    await page.goto("https://example.com/docs");
    await page.getByRole("searchbox").fill("billing");

    await expect(page.getByRole("link", { name: /billing/i })).toBeVisible();
  },
);
launch: true gives the callback a ready-to-use page.

Pick A Browser

Change the target to run in another browser. Safari targets run with Playwright WebKit.
{ target: "Web - Chrome", launch: true }
See the full current list in Target Literals.

Pass Launch Options

When startup options are known up front, put them in the flow definition.
import { flow } from "@qawolf/flows/web";

export default flow(
  "Use saved session",
  {
    target: "Web - Chrome",
    launch: {
      browserContext: "persistent",
      userDataDir: "/tmp/qawolf-profile",
    },
  },
  async ({ page }) => {
    await page.goto("https://example.com/account");
  },
);
For every browser and Electron launch field, see the Web Reference.

Launch Manually For Advanced Control

Call launch() yourself only when startup depends on callback logic.
import { flow, launch } from "@qawolf/flows/web";

export default flow("Open account", "Web - Chrome", async () => {
  const useSavedProfile = process.env["USE_SAVED_PROFILE"] === "true";

  const launchResult = await launch(
    useSavedProfile
      ? {
          browserContext: "persistent",
          userDataDir: "/tmp/qawolf-profile",
        }
      : undefined,
  );
  if (!("context" in launchResult)) throw new Error("Expected browser launch");

  const page =
    "page" in launchResult
      ? launchResult.page
      : await launchResult.context.newPage();

  await page.goto("https://example.com/account");
});

Launch Electron

Use the Electron launch kind when the target is an app instead of a website.
import { flow } from "@qawolf/flows/web";

export default flow(
  "Open desktop app",
  {
    target: "Web - Chrome",
    launch: {
      kind: "electron",
      executablePath: "/Applications/MyApp.app/Contents/MacOS/MyApp",
    },
  },
  async ({ page }) => {
    await page.getByRole("button", { name: "Sign in" }).click();
  },
);
The Electron callback receives the first window as page.

Assertions

Import expect from @qawolf/flows/web so assertions are connected to the QA Wolf runtime.
import { expect } from "@qawolf/flows/web";

await expect(page.getByText("Saved")).toBeVisible();
Last modified on April 24, 2026