goog.testing.TestRunner
Provided By |
---|
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.
new TestRunner()
Parameters | None. |
---|
Instance Methods
this.clearUniqueId() → void
void
Clears the unique id for this page. The value will hint the reason.
this.execute() → void
void
Executes a test case and prints the results to the window.
this.getNumFilesLoaded() → number
number
Returns the number of script files that were loaded in order to run the test.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getReport( opt_verbose ) → string
string
this.getRunTime() → number
number
Returns the amount of time it took for the test to run. Used by Selenium Hooks.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getSearchString() → string
string
The uuid is embedded in the URL search. This function allows us to mock the search in the test.
Parameters | None. | |
---|---|---|
Returns |
|
this.getTestResultsAsJson() → (string|null)
(string|null)
Returns the test results as json. This is called by the testing infrastructure through G_testrunner.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getUniqueId() → string
string
this.hasErrors() → boolean
boolean
Returns true if the test case runner has errors that were caught outside of the test case.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.initialize( testCase ) → void
void
Initializes the test runner.
Parameters |
|
---|
this.isComplete() → boolean
boolean
Returns true if the test runner is finished.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isFinished() → boolean
boolean
Returns false if the test runner has not finished successfully. Used by Selenium Hooks.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isInitialized() → boolean
boolean
Returns true if the test runner is initialized. Used by Selenium Hooks.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isStrict() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isSuccess() → boolean
boolean
Returns true if the test case didn't fail. Used by Selenium Hooks.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.log( s ) → void
void
Logs a message to the current test case.
Parameters |
|
---|
this.logError( msg ) → void
void
Logs an error that occurred. Used in the case of environment setting up an onerror handler.
Parameters |
|
---|
this.logTestFailure( ex ) → void
void
this.setErrorFilter( fn ) → void
void
Sets a function to use as a filter for errors.
Parameters |
|
---|
this.setStrict( strict ) → void
void
By default, the test runner is strict, and fails if it runs an empty test case.
Parameters |
|
---|
this.writeLog( log ) → void
void
Writes a nicely formatted log out to the document.
Parameters |
|
---|
Instance Properties
Errors that occurred in the window.
this.initialized → boolean
boolean
Whether the test runner has been initialized yet.
this.testCase → (goog.testing.TestCase|null)
(goog.testing.TestCase|null)
Reference to the active test case.
Static Properties
TestRunner.TEST_LOG_ID → string
string
No information.