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


---

# 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.testery.io/integrations/ci-cd-integration-guide/tugboatqa.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.
