Article - Integrating Squish GUI Tester with Squish Coco

Skip to end of metadata
Go to start of metadata

The code coverage tool Squish Coco does not only work with unit tests. It can also be used to analyze the coverage of GUI tests. It's easily possible to run tools alongside each other. That will give the C/C++ code coverage of the whole test suite. A more in-depth analysis will be possible when correlating each test case (and its results) with the respective coverage information. Especially since Squish Coco features the comparisons of individual executions including the calculation of an optimal order.

General Approach

The approach depicted below is based on the possibility to apply information about the name, the result and a free-form comment to each execution (stored in a *.csexe files). See the documentation section Execution Comment, Name And Status for more details.

As an example we'll use Squish for Qt's addressbook on a Unix-based system and a JavaScript test script.

  1. First we'll initialize the execution data with the name of the Squish test case that is being run:
    test.js
  2. Insert the main test script at this point
  3. After the main test script we'll log the result of the test for the coverage tool:
    test.js continued

When you execute scripts containing these steps, the Squish Coco Execution Report loads with the test case name, status and execution summary in the execution details and comments.

Simplified for Reuse

  1. Create a file called squishCocoLogging.js in Test Suite Resources with the following functions:
    JAVASCRIPT - squishCocoLogging.js
    PYTHON - squishCocoLogging.py
  2. Add the following function calls after startApplication() in the main test script:
    JAVASCRIPT- test.js part a
    PYTHON - test.py part a
  3. At the end of your script, after closing the AUT (for example with steps clicking File > Exit), call the following function:
    JAVASCRIPT- test.js part b
    PYTHON - test.py part b
  4. In the event your AUT closes unexpectedly, or a script error occurs, incorporating a try, catch, finally ensures your results still output to the Coco report file

Your main test script should appear similar to the following:

JAVASCRIPT - test.js example
PYTHON - test.js example
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.