Class goog.testing.TestRunner

code »

Construct a test runner. NOTE(user): This is currently pretty weird, I'm essentially trying to create a wrapper that the Selenium test can hook into to query the state of the running test case, while making goog.testing.TestCase general.

Constructor

goog.testing.TestRunner ( )
Show:

Instance Methods

Executes a test case and prints the results to the window.

Returns the number of script files that were loaded in order to run the test.

Returns
The number of script files.
code »getReport ( opt_verbose )string

Returns a report of the test case that ran. Used by Selenium Hooks.

Parameters
opt_verbose: boolean=
If true results will include data about all tests, not just what failed.
Returns
A report summary of the test.

Returns the amount of time it took for the test to run. Used by Selenium Hooks.

Returns
The run time, in milliseconds.
Returns
A map of test names to a list of test failures (if any) to provide formatted data for the test runner.

Returns true if the test case runner has errors that were caught outside of the test case.

Returns
Whether there were JS errors.
code »initialize ( testCase )

Initializes the test runner.

Parameters
testCase: goog.testing.TestCase
The test case to initialize with.

Returns true if the test runner is finished. Used by Selenium Hooks.

Returns
Whether the test runner is active.

Returns true if the test runner is initialized. Used by Selenium Hooks.

Returns
Whether the test runner is active.
Returns
Whether the test runner should fail on an empty test case.

Returns true if the test case didn't fail. Used by Selenium Hooks.

Returns
Whether the current test returned successfully.

Logs a message to the current test case.

Parameters
s: string
The text to output to the log.

Logs an error that occurred. Used in the case of environment setting up an onerror handler.

Parameters
msg: string
Error message.

Log failure in current running test.

Parameters
ex: Error
Exception.

Writes the results to the document when the test case completes.

Sets a function to use as a filter for errors.

Parameters
fn: function(string)
Filter function.
code »setStrict ( strict )

By default, the test runner is strict, and fails if it runs an empty test case.

Parameters
strict: boolean
Whether the test runner should fail on an empty test case.

Writes a nicely formatted log out to the document.

Parameters
log: string
The string to write.

Instance Properties

Function to use when filtering errors.

Errors that occurred in the window.

Whether the test runner has been initialized yet.

Element created in the document to add test results to.

Whether an empty test case counts as an error.

Reference to the active test case.