> ## Documentation Index
> Fetch the complete documentation index at: https://piyushvyas.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipes

> Pre-built recipe commands for common browser tasks: login, fill-form, and wait-for.

# Recipes

Built-in recipe commands for common browser automation patterns. Recipes combine multiple BAP commands into single, parameterized operations.

## login

Automate a login flow with one command.

```bash theme={null}
bap recipe login https://app.example.com/login --user=admin@example.com --pass=secret123
```

<ParamField path="url" type="string" required>
  The login page URL.
</ParamField>

<ParamField path="--user" type="string" required>
  Username or email to fill.
</ParamField>

<ParamField path="--pass" type="string" required>
  Password to fill.
</ParamField>

The recipe navigates to the URL, observes the page to find username/password fields, fills them, and clicks the submit button.

## fill-form

Fill a form using data from a JSON file.

```bash theme={null}
bap recipe fill-form https://app.example.com/signup --data=form-data.json
```

<ParamField path="url" type="string" required>
  The page URL containing the form.
</ParamField>

<ParamField path="--data" type="string" required>
  Path to a JSON file mapping field labels or selectors to values.
</ParamField>

Example `form-data.json`:

```json theme={null}
{
  "Name": "Jane Doe",
  "Email": "jane@example.com",
  "Country": "Canada",
  "I agree to the terms": true
}
```

## wait-for

Wait for an element to appear on the page.

```bash theme={null}
bap recipe wait-for role:button:"Continue"
bap recipe wait-for text:"Order confirmed" --timeout=30000
```

<ParamField path="selector" type="string" required>
  Selector for the element to wait for.
</ParamField>

<ParamField path="--timeout" type="number" default="10000">
  Maximum wait time in milliseconds.
</ParamField>

<Tip>
  Use `wait-for` after actions that trigger asynchronous page updates, like form submissions or API
  calls that update the DOM.
</Tip>
