# Testing

## Getting tests to work

Run `mix test` to run the tests.&#x20;

Petal Pro also comes with some end-to-end (E2E) tests (see `signup_test.exs`). We use the library Wallaby for this.

Wallaby tests don't run by default as they can be slow. We have hidden them behind a "feature" flag.

```bash
# Run all tests, including wallaby:
mix test --include feature

# Run only wallaby
mix test --only feature

# Or use our alias to run only wallaby:
mix wallaby
```

For E2E tests to work, you must install [Chromedriver](https://chromedriver.chromium.org/downloads), which will run the tests like you were clicking things in a browser. On a Mac, you can install it with:

```
brew install --cask chromedriver
```

Then to run the E2E tests run `mix test --only feature`. Or you could use our alias `mix wallaby` (see aliases defined in `mix.exs`).

On Mac, you may get the error:

> Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser

&#x20;If this happens, you can run this command:

```
xattr -d com.apple.quarantine $(which chromedriver)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.petal.build/petal-pro-documentation/v2.2.0/fundamentals/testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
