selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
76 lines (70 loc) • 39.9 kB
HTML
<meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.testing.TestCase</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class webdriver.testing.TestCase</h1><a class="source" href="source/lib/webdriver/testing/testcase.js.src.html#l48">code »</a><pre><code><a href="class_goog_testing_TestCase.html">goog.testing.TestCase</a>
└ webdriver.testing.TestCase</code></pre></header><section><p>Constructs a test case that synchronizes each test case with the singleton
<code >webdriver.promise.ControlFlow</code>.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">webdriver.testing.TestCase <span class="args">( client, opt_name )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>client: <code class="type">!webdriver.testing.Client</code><dd>The test client to use for
reporting test results.<dt>opt_name: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The name of the test case, defaults to
'Untitled Test Case'.</dl></table></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><h3>Defined in <code class="type">webdriver.testing.TestCase</code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/testing/testcase.js.src.html#l61">code »</a><span class="member"><a name="cycleTests">cycleTests</a> <span class="args">( )</span></span></div><p>Executes the next test inside its own <code >webdriver.Application</code>.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/testing/testcase.js.src.html#l96">code »</a><span class="member"><a name="logError">logError</a> <span class="args">( name, opt_e )</span> ⇒ <code class="type">goog.testing.TestCase.Error</code></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>name<dt>opt_e</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/testing/testcase.js.src.html#l154">code »</a><span class="member"><a name="runSingleTest_">runSingleTest_</a> <span class="args">( test, onError )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Executes a single test, scheduling each phase with the global application.
Each phase will wait for the application to go idle before moving on to the
next test phase. This function models the follow basic test flow:
try {
this.setUp.call(test.scope);
test.ref.call(test.scope);
} catch (ex) {
onError(ex);
} finally {
try {
this.tearDown.call(test.scope);
} catch (e) {
onError(e);
}
}</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>test: <code class="type">!<a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code><dd>The test to run.<dt>onError: <code class="type">function(*)</code><dd>The function to call each time an error is
detected.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved when the
test has finished running.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_goog_testing_TestCase.html">goog.testing.TestCase</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l289">code »</a><span class="member"><a name="add">add</a> <span class="args">( test )</span></span></div><p>Adds a new test to the test case.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>test: <code class="type"><a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code><dd>The test to add.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l310">code »</a><span class="member"><a name="addNewTest">addNewTest</a> <span class="args">( name, ref, opt_scope )</span></span></div><p>Creates and adds a new test.
Convenience function to make syntax less awkward when not using automatic
test discovery.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>name: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The test name.<dt>ref: <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>Reference to the test function.<dt>opt_scope: <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>=</code><dd>Optional scope that the test function should be
called in.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l751">code »</a><span class="member"><a name="autoDiscoverLifecycle">autoDiscoverLifecycle</a> <span class="args">( )</span></span></div><p>Adds any functions defined in the global scope that correspond to
lifecycle events for the test case. Overrides setUp, tearDown, setUpPage,
tearDownPage and runTests if they are defined.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l777">code »</a><span class="member"><a name="autoDiscoverTests">autoDiscoverTests</a> <span class="args">( )</span></span></div><p>Adds any functions defined in the global scope that are prefixed with "test"
to the test case.</summary></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l933">code »</a><span class="member"><a name="clearTimeout">clearTimeout</a> <span class="args">( id )</span></span></div><p>Clears a timeout created by <code >this.timeout()</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>id: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>A timeout id.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l900">code »</a><span class="member"><a name="countNumFilesLoaded_">countNumFilesLoaded_</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Counts the number of files that were loaded for dependencies that are
required to run the test.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The number of files loaded.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l740">code »</a><span class="member"><a name="createTestFromAutoDiscoveredFunction">createTestFromAutoDiscoveredFunction</a> <span class="args">( name, ref )</span> ⇒ <code class="type">!<a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code></span></div><p>Creates a <code >goog.testing.TestCase.Test</code> from an auto-discovered
function.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>name: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the function.<dt>ref: <code class="type">function(): void</code><dd>The auto-discovered function.</dl><tr><th>Returns<tr><td><dl>The newly created test.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l1018">code »</a><span class="member"><a name="doError">doError</a> <span class="args">( test, opt_e )</span></span></div><p>Handles a test that failed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>test: <code class="type"><a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code><dd>The test that failed.<dt>opt_e: <code class="type">*=</code><dd>The exception object associated with the
failure or a string.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l998">code »</a><span class="member"><a name="doSuccess">doSuccess</a> <span class="args">( test )</span></span></div><p>Handles a test that passed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>test: <code class="type"><a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code><dd>The test that passed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l404">code »</a><span class="member"><a name="execute">execute</a> <span class="args">( )</span></span></div><p>Executes each of the tests.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l426">code »</a><span class="member"><a name="finalize">finalize</a> <span class="args">( )</span></span></div><p>Finalizes the test case, called when the tests have finished executing.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l349">code »</a><span class="member"><a name="getActuallyRunCount">getActuallyRunCount</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Returns the number of tests actually run in the test case, i.e. subtracting
any which are skipped.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The number of un-ignored tests.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l709">code »</a><span class="member"><a name="getAutoDiscoveryPrefix">getAutoDiscoveryPrefix</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The function name prefix used to auto-discover tests.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l718">code »</a><span class="member"><a name="getBatchTime">getBatchTime</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Time since the last batch of tests was started.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l339">code »</a><span class="member"><a name="getCount">getCount</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Returns the number of tests contained in the test case.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The number of tests.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l648">code »</a><span class="member"><a name="getGlobals">getGlobals</a> <span class="args">( opt_prefix )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Gets list of objects that potentially contain test cases. For IE 8 and below,
this is the global "this" (for properties set directly on the global this or
window) and the RuntimeObject (for global variables and functions). For all
other browsers, the array simply contains the global this.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_prefix: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>An optional prefix. If specified, only get things
under this prefix. Note that the prefix is only honored in IE, since it
supports the RuntimeObject:
http://msdn.microsoft.com/en-us/library/ff521039%28VS.85%29.aspx
TODO: Remove this option.</dl><tr><th>Returns<tr><td><dl>A list of objects that should be inspected.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l153">code »</a><span class="member"><a name="getName">getName</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The name of the test.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l569">code »</a><span class="member"><a name="getNumFilesLoaded">getNumFilesLoaded</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Returns the number of script files that were loaded in order to run the test.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The number of script files.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l528">code »</a><span class="member"><a name="getReport">getReport</a> <span class="args">( opt_verbose )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Returns a string detailing the results from the test.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_verbose: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>If true results will include data about all
tests, not just what failed.</dl><tr><th>Returns<tr><td><dl>The results from the test.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l560">code »</a><span class="member"><a name="getRunTime">getRunTime</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Returns the amount of time it took for the test to run.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The run time, in milliseconds.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l579">code »</a><span class="member"><a name="getTestResults">getTestResults</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Returns the test results object: a map from test names to a list of test
failures (if any exist).</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Tests results object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l330">code »</a><span class="member"><a name="getTests">getTests</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a>></code></span></div><p>Gets the tests.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The test array.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l957">code »</a><span class="member"><a name="getTimeStamp_">getTimeStamp_</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Returns the current time.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>HH:MM:SS.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l484">code »</a><span class="member"><a name="isInsideMultiTestRunner">isInsideMultiTestRunner</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the test case is running inside the multi test
runner.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l517">code »</a><span class="member"><a name="isSuccess">isSuccess</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the test was a success.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l494">code »</a><span class="member"><a name="log">log</a> <span class="args">( val )</span></span></div><p>Logs an object to the console, if available.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>val: <code class="type">*</code><dd>The value to log. Will be ToString'd.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l830">code »</a><span class="member"><a name="maybeFailTestEarly">maybeFailTestEarly</a> <span class="args">( testCase )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Checks to see if the test should be marked as failed before it is run.
If there was an error in setUpPage, we treat that as a failure for all tests
and mark them all as having failed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>testCase: <code class="type"><a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code><dd>The current test case.</dl><tr><th>Returns<tr><td><dl>Whether the test was marked as failed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l358">code »</a><span class="member"><a name="next">next</a> <span class="args">( )</span> ⇒ <code class="type"><a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a></code></span></div><p>Returns the current test and increments the pointer.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The current test case.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l945">code »</a><span class="member"><a name="now">now</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The current time in milliseconds, don't use goog.now as some
tests override it.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l606">code »</a><span class="member"><a name="orderTests_">orderTests_</a> <span class="args">( tests )</span></span></div><p>Reorders the tests depending on the <code >order</code> field.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>tests: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a>></code><dd>An array of tests to
reorder.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l977">code »</a><span class="member"><a name="pad_">pad_</a> <span class="args">( number )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Pads a number to make it have a leading zero if it's less than 10.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>number: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The number to pad.</dl><tr><th>Returns<tr><td><dl>The resulting string.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l373">code »</a><span class="member"><a name="reset">reset</a> <span class="args">( )</span></span></div><p>Resets the test case pointer, so that next returns the first test.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l590">code »</a><span class="member"><a name="runTests">runTests</a> <span class="args">( )</span></span></div><p>Executes each of the tests.
Overridable by the individual test case. This allows test cases to defer
when the test is actually started. If overridden, finalize must be called
by the test to indicate it has finished.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l475">code »</a><span class="member"><a name="saveMessage">saveMessage</a> <span class="args">( message )</span></span></div><p>Saves a message to the result set.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>message: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The message to save.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l727">code »</a><span class="member"><a name="setBatchTime">setBatchTime</a> <span class="args">( batchTime )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>batchTime: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>Time since the last batch of tests was started.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l384">code »</a><span class="member"><a name="setCompletedCallback">setCompletedCallback</a> <span class="args">( fn )</span></span></div><p>Sets the callback function that should be executed when the tests have
completed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The callback function.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l321">code »</a><span class="member"><a name="setTests">setTests</a> <span class="args">( tests )</span></span></div><p>Sets the tests.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>tests: <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="class_goog_testing_TestCase_Test.html">goog.testing.TestCase.Test</a>></code><dd>A new test array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l695">code »</a><span class="member"><a name="setUp">setUp</a> <span class="args">( )</span></span></div><p>Gets called before every goog.testing.TestCase.Test is been executed. Can be
overridden to add set up functionality to each test.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l681">code »</a><span class="member"><a name="setUpPage">setUpPage</a> <span class="args">( )</span></span></div><p>Gets called before any tests are executed. Can be overridden to set up the
environment for the whole test case.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l396">code »</a><span class="member"><a name="shouldRunTests">shouldRunTests</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Can be overridden in test classes to indicate whether the tests in a case
should be run in that particular situation. For example, this could be used
to stop tests running in a particular browser, where browser support for
the class under test was absent.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether any of the tests in the case should be run.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l702">code »</a><span class="member"><a name="tearDown">tearDown</a> <span class="args">( )</span></span></div><p>Gets called after every goog.testing.TestCase.Test has been executed. Can be
overriden to add tear down functionality to each test.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l688">code »</a><span class="member"><a name="tearDownPage">tearDownPage</a> <span class="args">( )</span></span></div><p>Gets called after all tests have been executed. Can be overridden to tear
down the entire test case.</summary></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l919">code »</a><span class="member"><a name="timeout">timeout</a> <span class="args">( fn, time )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Calls a function after a delay, using the protected timeout.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to call.<dt>time: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>Delay in milliseconds.</dl><tr><th>Returns<tr><td><dl>The timeout id.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l988">code »</a><span class="member"><a name="trimPath_">trimPath_</a> <span class="args">( path )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Trims a path to be only that after google3.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>path: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The path to trim.</dl><tr><th>Returns<tr><td><dl>The resulting string.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">webdriver.testing.TestCase</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/testing/testcase.js.src.html#l52">code »</a><span class="member"><a name="client_">client_</a> : <code class="type">!webdriver.testing.Client</code></span></div></summary></details></div></div><h3>Defined in <code class="type"><a href="class_goog_testing_TestCase.html">goog.testing.TestCase</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l266">code »</a><span class="member"><a name="batchTime_">batchTime_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Time since the last batch of tests was started, if batchTime exceeds
<code class="type"><a class="unresolved-link">#maxRunTime</a></code> a timeout will be used to stop the tests blocking the
browser and a new batch will be started.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l274">code »</a><span class="member"><a name="currentTestPointer_">currentTestPointer_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Pointer to the current test.</summary></details></div></div><div class="wrap-details protected"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l234">code »</a><span class="member"><a name="exceptionBeforeTest">exceptionBeforeTest</a> : <code class="type">*</code></span></div><p>Exception object that was detected before a test runs.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l63">code »</a><span class="member"><a name="name_">name_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>A name for the test case.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l282">code »</a><span class="member"><a name="onCompleteCallback_">onCompleteCallback_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code></span></div><p>Optional callback that will be executed when the test has finalized.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l171">code »</a><span class="member"><a name="order">order</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>The order to run the auto-discovered tests in.</summary></details></div></div><div class="wrap-details protected"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l122">code »</a><span class="member"><a name="result_">result_</a> : <code class="type"><a href="class_goog_testing_TestCase_Result.html">goog.testing.TestCase.Result</a></code></span></div><p>Object used to encapsulate the test results.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l248">code »</a><span class="member"><a name="running">running</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the test case is running.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l256">code »</a><span class="member"><a name="startTime_">startTime_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Timestamp for when the test was started.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l241">code »</a><span class="member"><a name="started">started</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the test case has ever tried to execute.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l92">code »</a><span class="member"><a name="testsToRun_">testsToRun_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>Set of test names and/or indices to execute, or null if all tests should
be executed.
Indices are included to allow automation tools to run a subset of the
tests without knowing the exact contents of the test file.
Indices should only be used with SORTED ordering.
Example valid values:
<ul>
<li>[testName]
<li>[testName1, testName2]
<li>[2] - will run the 3rd test in the order specified
<li>[1,3,5]
<li>[testName1, testName2, 3, 5] - will work
<ul></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/testcase.js.src.html#l70">code »</a><span class="member"><a name="tests_">tests_</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Array of test functions that can be executed.</summary></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/testing/testcase.js.src.html#l48">code »</a><span class="member"><a name="webdriver.testing.TestCase.superClass_">webdriver.testing.TestCase.superClass_</a> : <code class="type"><a href="class_goog_testing_TestCase.html">goog.testing.TestCase.prototype</a></code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>