# @qawolf/flows

`@qawolf/flows` is a TypeScript toolkit designed to help you define QA Wolf
flows across web, mobile, desktop, and CLI targets.

To learn more about how to use `@qawolf/flows`, check out the
[API Reference](https://docs.qawolf.com/qawolf/libraries/flows/api-reference/index)
and [Documentation](https://docs.qawolf.com/qawolf/libraries/flows).

## Install

```sh
npm install @qawolf/flows
```

## Usage

Create a launch-enabled web flow to receive a ready-to-use Playwright `page`.

```ts
import { expect, flow } from "@qawolf/flows/web";

export default flow(
  "Sign in",
  { target: "Web - Chrome", launch: true },
  async ({ page }) => {
    await page.goto("https://example.com/login");
    await page.getByLabel("Email").fill("qa@example.com");
    await page.getByRole("button", { name: "Continue" }).click();

    await expect(page.getByText("Check your email")).toBeVisible();
  },
);
```

Use the matching entry point when your flow targets Android, iOS, or CLI execution.

```ts
import { flow as androidFlow } from "@qawolf/flows/android";
import { flow as cliFlow } from "@qawolf/flows/cli";
import { flow as iosFlow } from "@qawolf/flows/ios";
```
