Before you can start trigger visual tests on Trakr from Bitbucket, please make sure you have installed the integration app.
If you navigate to any of your Trakr project settings -> integrations, you should see something similar to the screen below: (If you see a different message under “Bitbucket” and do not see the fields below, it means you have not installed the integration app).
- Base Environment
The environment used to trigger visual comparison tests against. This normally should be a stable environment such as production or staging environment. When you create a pull request, a baseline screenshot will be generated in this environment.
The Bitbucket Cloud repository this project is connected to. The repository name should look like [username]/[repository name].
For example, you can find this information when you bring up the repository cloning window from Bitbucket:
In this case, your username is “bob123” and your repository name is “my_project“. The repository value for Trakr will be bob-123/my_project
Triggering the tests
Once you have configured the “Base environment” and “Repository“, Trakr will now able to trigger visual tests as part of your pull requests.
Creating a pull request
A baseline screenshot collection will be created when you create a new pull request in the specified repository.
The screenshot collection should have a name that looks like PR [pull request id] (base): [pull request title]. This will be the baseline screenshot Trakr use to perform visual testing later against development/build environments.
Trigger visual testing
To trigger a visual test in Trakr, you simply add a comment in the pull request.
Your comment should consist of two keywords:
- “trakr” – This tells the platform to trigger a visual test
- (optionally) a base URL of your “development/build” environment. For example, http://build123.example.com
Once you add the comment in the pull request, a visual test will be triggered against the baseline screenshot collection generated at the creation of the pull request.
FAQs on test triggering
- Do not format to your comment! (e.g. link the URL, etc)
- Case mixing is ok with the keyword, you can use “Trakr”, “trakr”, “TRAKR”.
- Your build environment URL should be publically accessible by trakr. You can use basic authentication and include the credentials in the URL such as http://username:firstname.lastname@example.org
- Your build environment URL should start with http or https, “build123.example.com” will not work
- If you do not specify a base URL for your build environment, a visual test will be triggered comparing the same environment as the base screenshot.