goog.testing.TestRunner
Classgoog.testing.TestRunner()
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.
.errors
{Array
.<string
>}Errors that occurred in the window.
.execute()
Executes a test case and prints the results to the window.
.getNumFilesLoaded()
Returns the number of script files that were loaded in order to run the test.
number
}
.getReport(opt_verbose)
Returns a report of the test case that ran. Used by Selenium Hooks.
opt_verbose
{boolean
=}
string
}
.getRunTime()
Returns the amount of time it took for the test to run. Used by Selenium Hooks.
number
}
.hasErrors()
Returns true if the test case runner has errors that were caught outside of the test case.
boolean
}
.initialize(testCase)
Initializes the test runner.
testCase
{goog.testing.TestCase
}
.initialized
{boolean
}Whether the test runner has been initialized yet.
.isFinished()
Returns true if the test runner is finished. Used by Selenium Hooks.
boolean
}
.isInitialized()
Returns true if the test runner is initialized. Used by Selenium Hooks.
boolean
}
.isStrict()
boolean
}
.isSuccess()
Returns true if the test case didn't fail. Used by Selenium Hooks.
boolean
}
.log(s)
Logs a message to the current test case.
s
{string
}
.logError(msg)
Logs an error that occurred. Used in the case of environment setting up an onerror handler.
msg
{string
}
.logTestFailure(ex)
Log failure in current running test.
ex
{Error
}
.setErrorFilter(fn)
Sets a function to use as a filter for errors.
fn
{function
(string
)}
.setStrict(strict)
By default, the test runner is strict, and fails if it runs an empty test case.
strict
{boolean
}
.testCase
{goog.testing.TestCase
?}Reference to the active test case.
.writeLog(log)
Writes a nicely formatted log out to the document.
log
{string
}