This article explains how to install and use the Applitools Eyes plug-in for the Atlassian Bamboo CI system.
The article assumes that you already have Bamboo installed on your system and that you know how to use it. Note that depending on your version of Bamboo, some of the necessary steps or screenshots may be different from what is described here.
You can install the Applitools Eyes App from the Atlassian Marketplace for Bamboo. Search for the plug-in using the term "Applitools".
How to do this is covered in the next two sections.
In each plan Job that has a visual test, go to the Tasks panel, click Add task and select the Applitools Task. If you don't see it in the list of task types, make sure you have chosen the "All" task type option.
The Applitools Bamboo plug-in passes information to the Eyes test by setting up three environment variables:
Most versions of the Eyes SDKs will detect and use these environment variables. If this is supported in the Eyes SDK that you use, then you don't need to change the test, but you do need to ensure that the test does not set the API key or set the batch directly so that the SDK will use the bamboo environment variables. Check that the test should not use the
set api key
set batch. If your test code does make these calls, then you should skip these calls when the test is invoked by Bamboo (you can test for the existence of these environment variables to detect if Bamboo invoked the test).
In your Eyes test code, add the following lines after you allocate the Eyes instance and before you open the test.
If you prefer not to change your test; then the alternative method is to convert the bamboo environment variables to the standard Applitools environment variables in a script, and then call you test program from that script. This will only work if the test does not use or directly since these calls would override the values set by the environment variables. Two examples of such a script are shown below, one for a Linux shell script and the second for a windows .bat script. In both cases the test is invoked using Node.js - you should replace this with whatever is appropriate for your test platform and language.
export APPLITOOLS_BATCH_ID=$bamboo_APPLITOOLS_BATCH_ID export APPLITOOLS_BATCH_NAME=$bamboo_APPLITOOLS_BATCH_NAME export APPLITOOLS_API_KEY=$bamboo_APPLITOOLS_API_KEY node $@
Windows .bat script
setx APPLITOOLS_BATCH_ID "%bamboo_APPLITOOLS_BATCH_ID%" setx APPLITOOLS_BATCH_NAME "%bamboo_APPLITOOLS_BATCH_NAME%" setx APPLITOOLS_API_KEY "%bamboo_APPLITOOLS_API_KEY%" node %*
Once you have such a script, you need to ensure that Bamboo calls your script instead of calling your test program directly. The next two sections describe two approaches to doing this.
With this option, you change the executable that runs the test to run the script instead of running the build tool directly. The script sets up the environment variables as described above and then calls the build tool. You need to do this for each build tool that executes Eyes tests.
With this option, instead of using a build tool task to start the test, you use a script task to call a script, and the script sets up the environment variables and calls the build tool as described above.
After your test has run, you can see the result of all the tests in the stage in the Bamboo window, Applitools test results tab.
You can use the various Eyes Test Manager tools on the Test results page. You can also open the step viewer by clicking one of the test thumbnails. If you open the Test editor (from the step thumbnail menu) then the Eyes Test Manager will be opened in a new browser tab, and you will have access to the full power of the Test Manager.