Test.Runner Class
Runs test suites and test cases, providing events to allowing for the interpretation of test results.
Item Index
Methods
- add static
- clear static
- getCoverage
- getName
- getResults
- isRunning
- isWaiting static
- resume static
- run static
- setName
Properties
Events
- begin static
- complete static
- error static
- fail static
- ignore static
- pass static
- testcasebegin static
- testcasecomplete static
- testsuitebegin static
- testsuitecomplete static
Methods
add
-
testObject
Adds a test suite or test case to the list of test objects to run.
Parameters:
-
testObject
ObjectEither a TestCase or a TestSuite that should be run.
clear
()
static
Removes all test objects from the runner.
getCoverage
-
format
Returns the coverage report for the files that have been executed. This returns only coverage information for files that have been instrumented using YUI Test Coverage and only those that were run in the same pass.
Parameters:
-
format
Function(Optional) A coverage format to return results in.
getName
()
String
Retrieves the name of the current result set.
Returns:
The name of the result set.
getResults
-
format
Returns the last complete results set from the TestRunner. Null is returned if the TestRunner is running or no tests have been run.
Parameters:
-
format
Function(Optional) A test format to return the results in.
isRunning
()
Boolean
Indicates that the TestRunner is busy running tests and therefore can't be stopped and results cannot be gathered.
Returns:
True if the TestRunner is running, false if not.
isWaiting
()
Boolean
static
Indicates if the TestRunner is waiting for a test to resume
Returns:
True if the TestRunner is waiting, false if not.
resume
-
segment
Resumes the TestRunner after wait() was called.
Parameters:
-
segment
FunctionThe function to run as the rest of the haulted test.
run
-
options
Runs the test suite.
setName
-
name
The name assigned to the master suite of the TestRunner. This is the name that is output as the root's name when results are retrieved.
Parameters:
-
name
StringThe name of the result set.
Properties
Events
begin
static
Fires when the run() method is called.
complete
static
Fires when all test suites and test cases have been completed.
error
static
Fires when a non-test method has an error.
fail
static
Fires when a test has failed.
ignore
static
Fires when a test has been ignored.
pass
static
Fires when a test has passed.
testcasebegin
static
Fires when a test case is opened but before the first test is executed.
testcasecomplete
static
Fires when all tests in a test case have been executed.
testsuitebegin
static
Fires when a test suite is opened but before the first test is executed.
testsuitecomplete
static
Fires when all test cases in a test suite have been completed.