Tests whether the timer is currently running.
@ @newTooltip("not running", "The timer is not running") @, @newText("on", "[on]") @ .before( newText("off", "[off]") ) @ .print() @, @newSelector("switch") @ .add( getText("on") , getText("off") ) @, @newTimer("quick", 500) @ .callback( getSelector("switch").select(getText("off")) ) @, @getSelector("switch") @ .callback( @ getSelector("switch").test.selected( getText("on") ) @ .success( getTimer("quick").start() ) @ ) @, @newButton("target", "Click here within 500ms of start") @ .print() @ .wait( $ getTimer("quick") $ .test.running() $ .failure( getTooltip("not running").print("target") ) @ )
- Shows off and on on a single line above a button reading Click here within 500ms of start. When on is clicked, the 500ms timer starts. If the button is clicked within 500ms, then the
runningtest is successful and the click is validated. If the target button is clicked before the timer has started (i.e. before on was clicked) or after the timer has ended, the
runningtest fails and the
waitcommand does not release the execution of the script: the click is not validated and a new attempt at a on-target click sequence within 500ms is necessary.