Squish/Waiting for Input from the Test Operator

From Qt Wiki
< Squish
Revision as of 15:01, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Waiting for input from the test operator

In the cases where Squish cannot automate the whole test case, such as when a coin needs to be inserted into a slot machine or a physical button needs to be pressed which Squish cannot simulate, you need some way of notifying the test operator. As we have access to the whole Qt API from Squish, this can easily be done with a QMessageBox:

As the call to information() won’t return until the user clicks the OK button, the script will be paused until that happens.

We can also use Squish’s powerful waitFor() command to continue the script immediately when the required action has occurred, without the user having to click a button, which can be useful in situations where an input cursor is not available for the test operator:

The waitFor() command will execute the specified code statement until it returns true, in which case it will continue. You can also specify a timeout as a second parameter to avoid the abscence of the test operator blocking the execution of all the remaining test cases.

Categories: