# TugboatQA

**Step 1. Update the init section for your service in  .tugboat/config.yml to install Python3 (if not already present).**

```
services:
  your-service-name:
    commands:
      init:
        apt-get install -y python3
        apt-get install -y python3-pip
```

**Step 2. Update the build section for your service in .tugboat/config.yml to run the tests.**

```
services:
  your-service-name:
    build: |
      # Install the Testery CLI
      pip3 install testery --upgrade

      # Register the preview environment with Testery.
      testery update-environment --create-if-not-exists --token "$TESTERY_TOKEN" --key "${TUGBOAT_PREVIEW}" --name "${TUGBOAT_PREVIEW}" --variable "TUGBOAT_DEFAULT_SERVICE_URL=${TUGBOAT_DEFAULT_SERVICE_URL}"
                
      # Start a test run.
      testery create-test-run --token "$TESTERY_TOKEN" --git-ref "$TUGBOAT_PREVIEW_SHA" --project "testery" --environment "${TUGBOAT_PREVIEW}"
```

**Step 3. Create a free Testery account and get your Testery token.**

Click [here](https://testery.io/signup?plan=free) to sign up for a free account. Be sure to select Cypress as your test runner.

Get your Testery token by clicking on `Settings` -> `Integrations` -> `Show API Token`.

Copy the token that is displayed.![](https://blog.testery.io/content/images/2020/06/image.png)

**Step 4. Save your Testery token in the Tugboat project settings.**

In Tugboat, go to your Repository Settings and add your Testery token as an Environment Variable. Be sure to use the same Environment Variable name that was used in Step 2 (we called it `TESTERY_TOKEN`).![](https://blog.testery.io/content/images/2020/06/image-1.png)

**Step 5. You're All Set!**

You should now be able to run your Cypress tests on every PR. If you have any questions or need further assistance, please contact [support@testery.io](mailto://support@testery.io).

You'll now see test results directly on the pull request.\
![](https://blog.testery.io/content/images/2020/06/image-4.png)

Clicking `Details` will show you the results.

![](https://blog.testery.io/content/images/2020/06/image-2.png)
