This document describes how you can run a test that implements Applitools Eyes visual UI testing from within the build environment, and then see the results in the Azure DevOps Build result window.
The article assumes that you already have Azure DevOps installed on your system and that you know how to use it. Note that depending on your version of Azure DevOps, some of the steps or screenshots described here may be slightly different.
Overview
Once you have done the one time setup described in this article you will be able run your visual UI test from within the Azure DevOps environment and see the Eyes results within a Azure DevOps build results window as shown below:
Setting up Azure DevOps to work with Eyes involves the following steps:
Each of these is described in the sections that follow.
Preparing your Eyes code
The Eyes extension automatically generates a Batch name and batch ID and assigns them to environment variables. Your code should access the environment variables and use these value.
The batch name defined by the Eyes Extension is composed of the project name and the build definition name as defined in the Azure DevOps environment.
Note that the extension uses environment variables in two different ways.
APPLITOOLS_API_KEY
is an environment variable that you need to define in your operating system or in Azure DevOps, as explained in the next section.
The environment variables APPLITOOLS_BATCH_NAME
and APPLITOOLS_BATCH_ID
are defined and set by the Eyes SDK Azure DevOps extension; you should not define these variables in your operating system.
Setup your Azure DevOps build
The Eyes extension needs access to your Eyes API key. It obtains the value of the key from an environment variable called APPLITOOLS_API_KEY
You can set the environment key externally via your operating system, or you can do it internally in Azure DevOps as follows:
-
On the "Pipelines" page, "Runs" tab select your build by clicking on it.
-
Click on the Edit Pipeline button.
-
In the Variables tab, click the Add button.
-
In the left input field type the name of the environmental variable APPLITOOLS_API_KEY, and in the right field type your API key. To obtain your API key see How to obtain your API key. Click on save, and in the Dialog that opens add a comment and click Save.
Installing the Eyes Extension
-
-
-
Add the Applitools Eyes build task. In Azure DevOps, click on the "Browse Marketplace", then search for Applitools.2. Download and install
3. Refresh the browser.
-
-
Adding the Applitools task to the job using YAML
-
On the "Pipelines" page, "Runs" tab select your build by clicking on it.
-
Click on the Edit Pipeline button.3. Add "Applitools Build Task" to the step prior to your build task.
4. Save and run your build. After the run completes, you'll be able to click on the Applitools tab and view your results for this build.