Putting Your GUI Tests Under Version Control

Since GUI tests mostly rely on text-based contents, they can be put under version control in systems like Git or SVN. In this blog, we cover how a Version Control System (VCS) works, advantages to using a VCS with your GUI testing, and demonstrate setting up Squish GUI tests under version control using the Eclipse IDE. Let's get started.

How Does a Version Control System Work?

Version Control Systems work by establishing a repository, or database of changes, from which a user checks out a personal copy of the files, to which he, she or they authors changes. When changes are ready to be submitted to the repository, they are brought back through "commits." The repository is then a history of all changes made by the committers, and serves as a snapshot of the project.

Why Put Your GUI Tests Under Version Control?

Adopting a VCS and integrating it into your test automation worfklow is advantageous and highly advised. Where a mature test automation framework comprises multiple files, including test scripts, shared/global scripts, data files, shared data files, verification point files and object repositories, it becomes important not only to visualize ongoing changes to your project, but safeguard them in a controlled manner -- two selling points of a VCS.

How about a practical test development scenario? Let's say the need arises for testing an application which exists as multiple editions. The various app editions are built from different branches of source code. Testing may become complicated where each different revision uses different test scripts, or even different sets of test data for various features of the editions are required. Best practice for controlling such an environment is to manage your test suites under a VCS, preferably together under the same system with the application sources. Here, the application under test (AUT) sources and test scripts and test data are managed together within the same repository.

When the AUT source code is branched, and several different revisions exist in parallel, the associated test scripts can also exist on each of the branches. Tests can be adjusted indiviudally to match any requirements of the AUT revisions. The point: with a VCS, it maintains, manages, and tracks potentially large sets of test scripts and their data together with the constant changes and revisions, typical in a development cycle, that occur to your AUT.

Developing GUI Tests Under Version Control Using Squish

The Squish plugin for the Eclipse IDE makes possible developing your Squish GUI tests from Eclipse. The Eclipse IDE itself offers plugins for common Version Control Systems, including Git and SVN. Test suites can be created and maintained while under revision control with a few steps:

Step 1: Install the Squish integration plugin for Eclipse IDE

  • Download the plugin.
  • In the Eclipse IDE, select Menu > Help > Install New Software.
  • In the Install New Software dialog, select 'Add' and 'Local'.
  • Enter the path to the downloaded plugin .jar file.

Step 2: Install the Git integration for Eclipse

  • In the Eclipse IDE, select Menu > Help > Install New Software.
  • From the dropdown list, select '--All Available Sites--'.
  • Search and check the 'Git Integration for Eclipse' plugin.

Step 3: Add a Git View to the Squish Perspective

  • Set 'Squish Test Management' Perspective: Window > Perspective
  • Add a 'Git View' to the Squish Perspective: Window > Show View > Other

Eclipse IDE, showing the Git integration for developing Squish GUI tests.

Finally, you can then use 'Add Repository' or 'Checkout Repository' to add the location where your test scripts are stored.

Upcoming: Test Center & Git Integration

Used together with Squish, Test Center takes your test automation progress a step further. Test Center is a platform for test result analysis and management. Test Center has several built-in features for intelligently aggregating your results as a project evolves, monitoring your test outcomes, and analyzing key trends. To fit into -- and enhance -- existing workflows, Test Center comes with several integrations with external test- and requirements-management tools, popular CI/CD systems, and issue tracking and reporting platforms.

Coming soon to Test Center is a Git integration, which will make possible a) setting up Git repositories containing your test suites and b) mapping specific lines in your verison-controlled test script files to uploaded test execution results. The Test Center and Git integration will allow users of the platform to spot and fix regressions much faster, and from a centralized location.

Recommendations for Further Reading

Comments

    The Qt Company acquired froglogic GmbH in order to bring the functionality of their market-leading automated testing suite of tools to our comprehensive quality assurance offering.