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

# Automations

> Run E2E automation tests on devices

Automations are end-to-end tests that run directly on devices via [BRICKS Foundation](/foundation). Use them to simulate user interactions, verify application behavior, and perform visual regression testing.

## Automation types

BRICKS supports three types of automations:

| Type        | Description                                                |
| ----------- | ---------------------------------------------------------- |
| **Launch**  | Runs automatically when the application starts on a device |
| **Anytime** | Triggered manually or via the CLI at any time              |
| **Cron**    | Runs on a schedule at specified intervals                  |

### Launch automations on bind

When you [bind an application to a device](/controller/applications#binding-applications-to-devices), you can select a **Launch** type automation to run automatically each time the application starts. This is useful for self-check routines, data initialization, or automated setup that should happen on every launch.

## Open the automations panel

* **From the device** — Open the system menu and tap **Automations**
* **From BRICKS CLI** — Send the action to a device group:

```bash theme={null}
bricks group dispatch <group-id> test-panel-open
```

## Run automations from the CLI

Use the [BRICKS CLI](/cli) to trigger automations programmatically:

```bash theme={null}
# Start an automation
bricks app trigger <app-id> <test-id> --play

# Stop a running automation
bricks app trigger <app-id> <test-id> --stop

# Set up automation to run at launch
bricks app trigger <app-id> <test-id> --setup-at-launch

# Target a specific device group
bricks app trigger <app-id> <test-id> --play -g <group-id>
```

## Simulation actions

Automations can simulate user interactions on the device:

* **Brick press** — Simulate tapping a brick
* **Key events** — Simulate keyboard input
* **HTTP requests** — Send requests and validate responses

## Assertions

Automations include 6+ assertion types for validating application state:

* Verify data values match expected results
* Check generator output
* Validate canvas state
* **Visual regression** — Capture screenshots and compare against baseline images

## Define automations in code

When using [bricks-ctor](/ctor-pkg), automations are defined in the `automation-tests/` directory of your project:

```
my-app/
├── automation-tests/    # E2E test definitions
├── app.ts
├── subspaces/
└── ...
```

See the [bricks-ctor built-in skill](/ctor-pkg/skills) for detailed reference on automation types, simulation actions, and assertion patterns.

## Next steps

<CardGroup cols={2}>
  <Card title="Debug panel" icon="bug" href="/foundation/debug-panel">
    Inspect runtime state on the device.
  </Card>

  <Card title="Application management" icon="grid-2" href="/controller/applications">
    Manage application versions and deployment.
  </Card>
</CardGroup>
