Bitbucket Pipelines are the tool that can be used not only for building but also for testing and deploying applications. The testing part may also include automatic tests created with Squish GUI Tester. The following article describes how this can be achieved. Please note that this is not the only solution but rather one of the options that should give you a general overview of the setup and required components.
A proper Squish package is required. For the demo purpose, the squish-6.7.1-qt59x-linux64.run package is used. The Squish package is added to a dedicated Bitbucket repository (squishpackage) in a Squish version-specific branch (s671-qt59-lnx64). That allows simple switching between Squish packages based on the system and the application under test requirements.
This repository is pulled into a pipeline created for a different one named SquishTests. This package contains the Pipeline file and Squish test cases.
Get Squish package:
To allow cloning another please follow this article. Once it's done you can clone the Squish package into the pipeline.
Once the package is available in the pipeline it's time to install Squish. For that, the (unattended installation)[https://doc.qt.io/squish/installing-from-binary-packages.html#ins-binary-unattended] is required. The TMPDIR environment variable is set to specify the location of the temporary installation files.
Start Xvfb server:
As Squish requires some kind of a display, the Xvfb server provided within (the default build environment of Bitbucket Pipelines)[https://hub.docker.com/r/atlassian/default-image/] is used.
Register AUT and execute the tests:
Before starting the test cases, application under tests needs to be registered. In this example, the example Addressbook application is used.
In the above example, the test execution generates JUnit and HTML results. After the pipeline build is finished, both can be stored as build artifacts.
On top of that, the JUnit results can be accessed directly via the Tests tab on the build page.
The downloaded HTML report can be used for further result analysis.
Example pipeline file¶
The below example shows the complete example pipeline that installs Squish and executes tests against the example application and aggregates the test results. It also prepares the environment and installs some required libraries that were not part of the docker image.