Skip to main content

Using Applitools With Teamcity

Teamcity Plugin

This plugin enables you to get Applitools' tests results directly inside your TeamCity's results page.

Installation

Source Repository: https://github.com/applitools/eyes.teamcity/blob/master/README.md

  1. Download the latest version of the Applitools Eyes Plugin zip file.

  2. Copy applitools-eyes.zip to your TeamCity's plugins folder (e.g, ~/.BuildServer/Plugins).

  3. Restart TeamCity.

  4. From your TeamCity's Projects page go to: Administration -> Plugins List. You Should see the Applitools Eyes plugin under External plugins:

    Plugin List

Usage

Enabling Applitools Support

  1. Go to your project's page and click on Edit Project Settings and click on the build configuration for which you want to add Applitools.
  2. Click on Build Features and add Applitools Support.
  3. If you have Applitools' private cloud or on-premise server, you can set the server URL in the Applitools URL setting.

Updating Your Tests Code

The Applitools Plugin causes TeamCity to export the batch ID to the APPLITOOLS_BATCH_ID environment variable. You need to update your tests code to use this ID in order for your tests to appear in the Applitools window in the build results.

In addition, TeamCity exports a suggested batch name to the APPLITOOLS_BATCH_NAME environment variable. Using this batch name is optional (the batch name is used for display purposes only).

Following is an example:

BatchInfo batchInfo = new BatchInfo(System.getenv("APPLITOOLS_BATCH_NAME"));
// If the test runs via TeamCity, set the batch ID accordingly.
String batchId = System.getenv("APPLITOOLS_BATCH_ID");
if (batchId != null) {
batchInfo.setId(batchId);
}
eyes.setBatch(batchInfo);

Tests which will contain the above code, will show the Applitools results window inside TeamCity's tests results page (as can be seen in the screenshot at the top of this document).