oTest.$stoprun()
| Function group | Execute on client | Platform(s) |
|---|---|---|
| oTest | NO | All |
Syntax
oTest.$stoprun() – no params
Description
Stops a run started by $runsuite or $runtestcase. The callback is still called, with the unfinished tests reported as stopped or notRun. Returns kTrue if a run was stopped, or kFalse if there was no run to stop or it was called inside a test method, where it does nothing.
$stoprun() stops a test run started by oTest.$runsuite() or oTest.$runtestcase(), and returns kTrue if it stopped one, or kFalse if there was no such run in progress. A test waiting for a worker is given the outcome stopped, and the tests and classes the run had not yet reached are given the outcome notRun. The run's callback is still called, with those outcomes, before $stoprun() returns.
A run of synchronous tests is over before $runsuite() or $runtestcase() returns, so there is only something to stop while a test is waiting for a worker. Call $stoprun() from somewhere else, such as a button, a timer or a worker callback.
$stoprun() returns kFalse and does nothing while a test method is executing, because the run would end with that method still running. A run started from the Test Suites window, the Test editor or the MCP server's execute_test tool is not stopped by $stoprun(); stop it where it was started.