testing.TestRunner Extends
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.

Inheritance

Constructor

goog.testing.TestRunner()

Instance Methods

Public Protected Private
errorFilter_()
Function to use when filtering errors.
code »
execute()
Executes a test case and prints the results to the window.
code »
getNumFilesLoaded() number
Returns the number of script files that were loaded in order to run the test.
Returns: number  The number of script files.
code »
getReport(opt_verbose) string
Returns a report of the test case that ran. Used by Selenium Hooks.
Arguments:
opt_verbose : boolean=
If true results will include data about all tests, not just what failed.
Returns: string  A report summary of the test.
code »
getRunTime() number
Returns the amount of time it took for the test to run. Used by Selenium Hooks.
Returns: number  The run time, in milliseconds.
code »
getTestResults() Object.<string, !Array.<string>>
No description.
Returns: Object.<string, !Array.<string>>  A map of test names to a list of test failures (if any) to provide formatted data for the test runner.
code »
hasErrors() boolean
Returns true if the test case runner has errors that were caught outside of the test case.
Returns: boolean  Whether there were JS errors.
code »
initialize(testCase)
Initializes the test runner.
Arguments:
testCase : goog.testing.TestCase
The test case to initialize with.
code »
isFinished() boolean
Returns true if the test runner is finished. Used by Selenium Hooks.
Returns: boolean  Whether the test runner is active.
code »
isInitialized() boolean
Returns true if the test runner is initialized. Used by Selenium Hooks.
Returns: boolean  Whether the test runner is active.
code »
isStrict() boolean
No description.
Returns: boolean  Whether the test runner should fail on an empty test case.
code »
isSuccess() boolean
Returns true if the test case didn't fail. Used by Selenium Hooks.
Returns: boolean  Whether the current test returned successfully.
code »
log(s)
Logs a message to the current test case.
Arguments:
s : string
The text to output to the log.
code »
logError(msg)
Logs an error that occurred. Used in the case of environment setting up an onerror handler.
Arguments:
msg : string
Error message.
code »
logTestFailure(ex)
Log failure in current running test.
Arguments:
ex : Error
Exception.
code »
onComplete_()
Writes the results to the document when the test case completes.
code »
setErrorFilter(fn)
Sets a function to use as a filter for errors.
Arguments:
fn : function(string)
Filter function.
code »
setStrict(strict)
By default, the test runner is strict, and fails if it runs an empty test case.
Arguments:
strict : boolean
Whether the test runner should fail on an empty test case.
code »
writeLog(log)
Writes a nicely formatted log out to the document.
Arguments:
log : string
The string to write.
code »

Instance Properties

errors :
Errors that occurred in the window.
Code »
initialized :
Whether the test runner has been initialized yet.
Code »
logEl_ :
Element created in the document to add test results to.
Code »
strict_ :
Whether an empty test case counts as an error.
Code »
Reference to the active test case.
Code »

Package testing

Package Reference