automationsquish

Run selected test cases in Squish for BDD design


Squish is an UI automation tool. Here I wanted to apply filters to select test cases. Or execute test cases need a condition to be run.


Solution

  • Squish offers few ways to run test cases from command line and have some control over them.

    1. To run a test suite from command line:

      squishrunner --testsuite /home/MyProject/suite_UI

    2.To run a particular test case/cases:

    squishrunner --testsuite /home/reggie/suite_addressbook [--testcase test_case_name]*
    
    1. To run a particular scenario (Usage of tags)

    Here you need to do some work. Let's say you want to categorise your tests between smoke test and Full Regression.

    So you can use tags on top of scenarios. It quite easy. Example: @smoke Scenario: To connect to the device, start the emulator Given I am in the Start Screen When I Click on Manual connection option Then I should be able to connect to the device

    @FullRegression
    Scenario: To connect to the using using Manual connection option with connection type as Ethernet Only
       Given Start Screen
       When I Click on Manual connection option for Ethernet Connection
       Then I should be able to connect to the sensor for Ethernet Only connection 
    

    To run all 'smoke' tags from a particular test case,

    --testcase "tst_com_device_ManualConnect" --tags @smoke
    
    1. Skipping tests

    You can skip one or many test cases,

    ----skip-testcase "tst_com_device_ManualConnect" --tags @smoke
    

    All except the ones with @smoke tag will be run.