# 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)
```
