selenium-webdriver 2.43.5 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +20 -0
- package/README.md +8 -13
- package/builder.js +4 -3
- package/docs/class_webdriver_Alert.html +6 -6
- package/docs/class_webdriver_AlertPromise.html +6 -6
- package/docs/class_webdriver_UnhandledAlertError.html +4 -4
- package/docs/class_webdriver_WebDriver.html +39 -37
- package/docs/class_webdriver_WebDriver_Logs.html +3 -3
- package/docs/class_webdriver_WebDriver_Navigation.html +5 -5
- package/docs/class_webdriver_WebDriver_Options.html +9 -9
- package/docs/class_webdriver_WebDriver_TargetLocator.html +6 -6
- package/docs/class_webdriver_WebDriver_Timeouts.html +4 -4
- package/docs/class_webdriver_WebDriver_Window.html +6 -6
- package/docs/class_webdriver_WebElement.html +23 -23
- package/docs/class_webdriver_WebElementPromise.html +22 -22
- package/docs/class_webdriver_promise_CancellationError.html +3 -0
- package/docs/class_webdriver_promise_ControlFlow.html +32 -32
- package/docs/class_webdriver_promise_Deferred.html +7 -8
- package/docs/class_webdriver_promise_Frame_.html +14 -30
- package/docs/class_webdriver_promise_Promise.html +2 -2
- package/docs/class_webdriver_promise_Task_.html +12 -12
- package/docs/class_webdriver_until_Condition.html +3 -0
- package/docs/enum_webdriver_Key.html +1 -1
- package/docs/enum_webdriver_promise_ControlFlow_EventType.html +1 -1
- package/docs/enum_webdriver_promise_Deferred_State_.html +1 -1
- package/docs/index.html +8 -13
- package/docs/interface_webdriver_promise_Thenable.html +8 -10
- package/docs/license.html +1 -1
- package/docs/module_selenium-webdriver.html +2 -2
- package/docs/module_selenium-webdriver__base.html +1 -1
- package/docs/module_selenium-webdriver__base_class_Context.html +1 -1
- package/docs/module_selenium-webdriver_builder.html +1 -1
- package/docs/module_selenium-webdriver_builder_class_Builder.html +1 -1
- package/docs/module_selenium-webdriver_chrome.html +1 -1
- package/docs/module_selenium-webdriver_chrome_class_Driver.html +2 -2
- package/docs/module_selenium-webdriver_chrome_class_Options.html +2 -2
- package/docs/module_selenium-webdriver_chrome_class_ServiceBuilder.html +1 -1
- package/docs/module_selenium-webdriver_error.html +1 -1
- package/docs/module_selenium-webdriver_executors.html +1 -1
- package/docs/module_selenium-webdriver_firefox.html +1 -1
- package/docs/module_selenium-webdriver_firefox_binary.html +1 -1
- package/docs/module_selenium-webdriver_firefox_binary_class_Binary.html +1 -1
- package/docs/module_selenium-webdriver_firefox_class_Driver.html +2 -2
- package/docs/module_selenium-webdriver_firefox_class_Options.html +1 -1
- package/docs/module_selenium-webdriver_firefox_extension.html +1 -1
- package/docs/module_selenium-webdriver_firefox_profile.html +1 -1
- package/docs/module_selenium-webdriver_firefox_profile_class_Profile.html +1 -1
- package/docs/module_selenium-webdriver_http.html +1 -1
- package/docs/module_selenium-webdriver_http_class_HttpClient.html +1 -1
- package/docs/module_selenium-webdriver_http_util.html +1 -1
- package/docs/module_selenium-webdriver_io.html +1 -1
- package/docs/module_selenium-webdriver_io_exec.html +1 -1
- package/docs/module_selenium-webdriver_net.html +1 -1
- package/docs/module_selenium-webdriver_net_portprober.html +1 -1
- package/docs/module_selenium-webdriver_phantomjs.html +1 -1
- package/docs/module_selenium-webdriver_phantomjs_class_Driver.html +2 -2
- package/docs/module_selenium-webdriver_proxy.html +1 -1
- package/docs/module_selenium-webdriver_remote.html +1 -1
- package/docs/module_selenium-webdriver_remote_class_DriverService.html +2 -2
- package/docs/module_selenium-webdriver_remote_class_SeleniumServer.html +2 -2
- package/docs/module_selenium-webdriver_testing.html +16 -29
- package/docs/module_selenium-webdriver_testing_assert.html +1 -1
- package/docs/namespace_webdriver_promise.html +18 -20
- package/docs/namespace_webdriver_stacktrace.html +15 -15
- package/docs/namespace_webdriver_until.html +32 -0
- package/docs/source/_base.js.src.html +1 -1
- package/docs/source/builder.js.src.html +1 -1
- package/docs/source/chrome.js.src.html +1 -1
- package/docs/source/error.js.src.html +1 -1
- package/docs/source/executors.js.src.html +1 -1
- package/docs/source/firefox/binary.js.src.html +1 -1
- package/docs/source/firefox/extension.js.src.html +1 -1
- package/docs/source/firefox/index.js.src.html +1 -1
- package/docs/source/firefox/profile.js.src.html +1 -1
- package/docs/source/http/index.js.src.html +1 -1
- package/docs/source/http/util.js.src.html +1 -1
- package/docs/source/index.js.src.html +1 -1
- package/docs/source/io/exec.js.src.html +1 -1
- package/docs/source/io/index.js.src.html +1 -1
- package/docs/source/lib/atoms/error.js.src.html +1 -1
- package/docs/source/lib/atoms/json.js.src.html +1 -1
- package/docs/source/lib/atoms/response.js.src.html +1 -1
- package/docs/source/lib/atoms/userAgent.js.src.html +1 -1
- package/docs/source/lib/goog/array/array.js.src.html +1 -1
- package/docs/source/lib/goog/asserts/asserts.js.src.html +1 -1
- package/docs/source/lib/goog/async/nexttick.js.src.html +1 -1
- package/docs/source/lib/goog/async/run.js.src.html +1 -1
- package/docs/source/lib/goog/base.js.src.html +1 -1
- package/docs/source/lib/goog/debug/debug.js.src.html +1 -1
- package/docs/source/lib/goog/debug/entrypointregistry.js.src.html +1 -1
- package/docs/source/lib/goog/debug/error.js.src.html +1 -1
- package/docs/source/lib/goog/debug/logbuffer.js.src.html +1 -1
- package/docs/source/lib/goog/debug/logger.js.src.html +1 -1
- package/docs/source/lib/goog/debug/logrecord.js.src.html +1 -1
- package/docs/source/lib/goog/deps.js.src.html +1 -1
- package/docs/source/lib/goog/disposable/disposable.js.src.html +1 -1
- package/docs/source/lib/goog/disposable/idisposable.js.src.html +1 -1
- package/docs/source/lib/goog/dom/browserfeature.js.src.html +1 -1
- package/docs/source/lib/goog/dom/dom.js.src.html +1 -1
- package/docs/source/lib/goog/dom/nodetype.js.src.html +1 -1
- package/docs/source/lib/goog/dom/tagname.js.src.html +1 -1
- package/docs/source/lib/goog/dom/vendor.js.src.html +1 -1
- package/docs/source/lib/goog/events/browserevent.js.src.html +1 -1
- package/docs/source/lib/goog/events/browserfeature.js.src.html +1 -1
- package/docs/source/lib/goog/events/event.js.src.html +1 -1
- package/docs/source/lib/goog/events/eventid.js.src.html +1 -1
- package/docs/source/lib/goog/events/events.js.src.html +1 -1
- package/docs/source/lib/goog/events/eventtarget.js.src.html +1 -1
- package/docs/source/lib/goog/events/eventtype.js.src.html +1 -1
- package/docs/source/lib/goog/events/keycodes.js.src.html +1 -1
- package/docs/source/lib/goog/events/listenable.js.src.html +1 -1
- package/docs/source/lib/goog/events/listener.js.src.html +1 -1
- package/docs/source/lib/goog/events/listenermap.js.src.html +1 -1
- package/docs/source/lib/goog/functions/functions.js.src.html +1 -1
- package/docs/source/lib/goog/iter/iter.js.src.html +1 -1
- package/docs/source/lib/goog/json/json.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/assertthat.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/logicmatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/matcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/numbermatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/objectmatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/stringmatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/useragent/browser.js.src.html +1 -1
- package/docs/source/lib/goog/labs/useragent/engine.js.src.html +1 -1
- package/docs/source/lib/goog/labs/useragent/util.js.src.html +1 -1
- package/docs/source/lib/goog/math/box.js.src.html +1 -1
- package/docs/source/lib/goog/math/coordinate.js.src.html +1 -1
- package/docs/source/lib/goog/math/math.js.src.html +1 -1
- package/docs/source/lib/goog/math/rect.js.src.html +1 -1
- package/docs/source/lib/goog/math/size.js.src.html +1 -1
- package/docs/source/lib/goog/net/wrapperxmlhttpfactory.js.src.html +1 -1
- package/docs/source/lib/goog/net/xhrlike.js.src.html +1 -1
- package/docs/source/lib/goog/net/xmlhttp.js.src.html +1 -1
- package/docs/source/lib/goog/net/xmlhttpfactory.js.src.html +1 -1
- package/docs/source/lib/goog/object/object.js.src.html +1 -1
- package/docs/source/lib/goog/reflect/reflect.js.src.html +1 -1
- package/docs/source/lib/goog/string/string.js.src.html +1 -1
- package/docs/source/lib/goog/structs/collection.js.src.html +1 -1
- package/docs/source/lib/goog/structs/map.js.src.html +1 -1
- package/docs/source/lib/goog/structs/set.js.src.html +1 -1
- package/docs/source/lib/goog/structs/structs.js.src.html +1 -1
- package/docs/source/lib/goog/style/style.js.src.html +1 -1
- package/docs/source/lib/goog/testing/asserts.js.src.html +1 -1
- package/docs/source/lib/goog/testing/asynctestcase.js.src.html +1 -1
- package/docs/source/lib/goog/testing/events/events.js.src.html +1 -1
- package/docs/source/lib/goog/testing/functionmock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/jsunit.js.src.html +1 -1
- package/docs/source/lib/goog/testing/loosemock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockclock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockcontrol.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockinterface.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockmatchers.js.src.html +1 -1
- package/docs/source/lib/goog/testing/objectpropertystring.js.src.html +1 -1
- package/docs/source/lib/goog/testing/propertyreplacer.js.src.html +1 -1
- package/docs/source/lib/goog/testing/recordfunction.js.src.html +1 -1
- package/docs/source/lib/goog/testing/stacktrace.js.src.html +1 -1
- package/docs/source/lib/goog/testing/strictmock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/testcase.js.src.html +1 -1
- package/docs/source/lib/goog/testing/testrunner.js.src.html +1 -1
- package/docs/source/lib/goog/testing/watchers.js.src.html +1 -1
- package/docs/source/lib/goog/uri/uri.js.src.html +1 -1
- package/docs/source/lib/goog/uri/utils.js.src.html +1 -1
- package/docs/source/lib/goog/useragent/product.js.src.html +1 -1
- package/docs/source/lib/goog/useragent/product_isversion.js.src.html +1 -1
- package/docs/source/lib/goog/useragent/useragent.js.src.html +1 -1
- package/docs/source/lib/webdriver/abstractbuilder.js.src.html +1 -1
- package/docs/source/lib/webdriver/actionsequence.js.src.html +1 -1
- package/docs/source/lib/webdriver/builder.js.src.html +1 -1
- package/docs/source/lib/webdriver/button.js.src.html +1 -1
- package/docs/source/lib/webdriver/capabilities.js.src.html +1 -1
- package/docs/source/lib/webdriver/command.js.src.html +1 -1
- package/docs/source/lib/webdriver/events.js.src.html +1 -1
- package/docs/source/lib/webdriver/firefoxdomexecutor.js.src.html +1 -1
- package/docs/source/lib/webdriver/http/corsclient.js.src.html +1 -1
- package/docs/source/lib/webdriver/http/http.js.src.html +1 -1
- package/docs/source/lib/webdriver/http/xhrclient.js.src.html +1 -1
- package/docs/source/lib/webdriver/key.js.src.html +1 -1
- package/docs/source/lib/webdriver/locators.js.src.html +1 -1
- package/docs/source/lib/webdriver/logging.js.src.html +1 -1
- package/docs/source/lib/webdriver/process.js.src.html +1 -1
- package/docs/source/lib/webdriver/promise.js.src.html +1 -1
- package/docs/source/lib/webdriver/session.js.src.html +1 -1
- package/docs/source/lib/webdriver/stacktrace.js.src.html +1 -1
- package/docs/source/lib/webdriver/testing/asserts.js.src.html +1 -1
- package/docs/source/lib/webdriver/testing/testcase.js.src.html +1 -1
- package/docs/source/lib/webdriver/until.js.src.html +1 -0
- package/docs/source/lib/webdriver/webdriver.js.src.html +1 -1
- package/docs/source/net/index.js.src.html +1 -1
- package/docs/source/net/portprober.js.src.html +1 -1
- package/docs/source/phantomjs.js.src.html +1 -1
- package/docs/source/proxy.js.src.html +1 -1
- package/docs/source/remote/index.js.src.html +1 -1
- package/docs/source/testing/assert.js.src.html +1 -1
- package/docs/source/testing/index.js.src.html +1 -1
- package/docs/types.js +1 -1
- package/example/google_search.js +9 -17
- package/example/google_search_generator.js +6 -7
- package/example/google_search_test.js +10 -18
- package/example/parallel_flows.js +4 -7
- package/index.js +6 -0
- package/lib/firefox/webdriver.xpi +0 -0
- package/lib/goog/deps.js +7 -5
- package/lib/test/index.js +0 -8
- package/lib/webdriver/promise.js +263 -251
- package/lib/webdriver/stacktrace.js +15 -1
- package/lib/webdriver/test/promise_flow_test.js +82 -76
- package/lib/webdriver/test/promise_test.js +22 -62
- package/lib/webdriver/test/stacktrace_test.js +18 -0
- package/lib/webdriver/test/until_test.js +388 -0
- package/lib/webdriver/test/webdriver_test.js +41 -0
- package/lib/webdriver/until.js +408 -0
- package/lib/webdriver/webdriver.js +91 -29
- package/package.json +2 -2
- package/test/element_finding_test.js +6 -6
- package/test/http/util_test.js +4 -5
- package/test/page_loading_test.js +7 -7
- package/test/stale_element_test.js +2 -10
- package/testing/index.js +9 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.WebElementPromise</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.WebElementPromise</h1><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
1
|
+
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.WebElementPromise</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.WebElementPromise</h1><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2125">code »</a><pre><code><a href="class_webdriver_WebElement.html">webdriver.WebElement</a>
|
|
2
2
|
└ webdriver.WebElementPromise</code></pre><dl><dt>All implemented interfaces:<dd><code><a href="">webdriver.promise.Thenable.<webdriver.WebElement></a></code></dl></header><section><p>WebElementPromise is a promise that will be fulfilled with a WebElement.
|
|
3
3
|
This serves as a forward proxy on WebElement, allowing calls to be
|
|
4
4
|
scheduled without directly on this instance before the underlying
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
});
|
|
12
12
|
</code></pre><h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">webdriver.WebElementPromise <span class="args">( driver, el )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>driver: <code class="type">!<a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code><dd>The parent WebDriver instance for this
|
|
13
13
|
element.<dt>el: <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd>A promise
|
|
14
|
-
that will resolve to the promised element.</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.WebElementPromise</code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
14
|
+
that will resolve to the promised element.</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.WebElementPromise</code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2129">code »</a><span class="member"><a name="cancel">cancel</a> <span class="args">( )</span></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2132">code »</a><span class="member"><a name="isPending">isPending</a> <span class="args">( )</span> ⇒ <code class="type">boolean</code></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2135">code »</a><span class="member"><a name="then">then</a> <span class="args">( )</span></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2138">code »</a><span class="member"><a name="thenCatch">thenCatch</a> <span class="args">( )</span></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2141">code »</a><span class="member"><a name="thenFinally">thenFinally</a> <span class="args">( )</span></span></div></summary></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2054">code »</a><span class="member"><a name="clear">clear</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<void></code></span></div><p>Schedules a command to clear the <code >value</code> of this element. This command
|
|
15
15
|
has no effect if the underlying DOM element is neither a text INPUT element
|
|
16
16
|
nor a TEXTAREA element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved
|
|
17
|
-
when the element has been cleared.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
18
|
-
when the click command has completed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
17
|
+
when the element has been cleared.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1831">code »</a><span class="member"><a name="click">click</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<void></code></span></div><p>Schedules a command to click on this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved
|
|
18
|
+
when the click command has completed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1771">code »</a><span class="member"><a name="findElement">findElement</a> <span class="args">( locator )</span> ⇒ <code class="type">!<a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code></span></div><p>Schedule a command to find a descendant of this element. If the element
|
|
19
19
|
cannot be found, a <code >bot.ErrorCode.NO_SUCH_ELEMENT</code> result will
|
|
20
20
|
be returned by the driver. Unlike other commands, this error cannot be
|
|
21
21
|
suppressed. In other words, scheduling a command to find an element doubles
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
</pre></code></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>locator: <code class="type">!(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|<a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The
|
|
50
50
|
locator strategy to use when searching for the element.</dl><tr><th>Returns<tr><td><dl>A WebElement that can be used to issue
|
|
51
51
|
commands against the located element. If the element is not found, the
|
|
52
|
-
element will be invalidated and all scheduled commands aborted.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
52
|
+
element will be invalidated and all scheduled commands aborted.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1812">code »</a><span class="member"><a name="findElements">findElements</a> <span class="args">( locator )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to find all of the descendants of this element that
|
|
53
53
|
match the given search criteria.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>locator: <code class="type">!(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|<a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The
|
|
54
54
|
locator strategy to use when searching for the elements.</dl><tr><th>Returns<tr><td><dl>A
|
|
55
|
-
promise that will resolve to an array of WebElements.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
55
|
+
promise that will resolve to an array of WebElements.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1960">code »</a><span class="member"><a name="getAttribute">getAttribute</a> <span class="args">( attributeName )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to query for the value of the given attribute of the
|
|
56
56
|
element. Will return the current value, even if it has been modified after
|
|
57
57
|
the page has been loaded. More exactly, this method will return the value of
|
|
58
58
|
the given attribute, unless that attribute is not present, in which case the
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<li>"readonly"
|
|
77
77
|
</ul></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>attributeName: <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 attribute to query.</dl><tr><th>Returns<tr><td><dl>A promise that will be
|
|
78
78
|
resolved with the attribute's value. The returned value will always be
|
|
79
|
-
either a string or null.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
79
|
+
either a string or null.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1922">code »</a><span class="member"><a name="getCssValue">getCssValue</a> <span class="args">( cssStyleProperty )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Schedules a command to query for the computed style of the element
|
|
80
80
|
represented by this instance. If the element inherits the named style from
|
|
81
81
|
its parent, the parent will be queried for its value. Where possible, color
|
|
82
82
|
values will be converted to their hex representation (e.g. #00ff00 instead of
|
|
@@ -85,29 +85,29 @@
|
|
|
85
85
|
<em>Warning:</em> the value returned will be as the browser interprets it, so
|
|
86
86
|
it may be tricky to form a proper assertion.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>cssStyleProperty: <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 CSS style property to look
|
|
87
87
|
up.</dl><tr><th>Returns<tr><td><dl>A promise that will be
|
|
88
|
-
resolved with the requested CSS value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
88
|
+
resolved with the requested CSS value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1697">code »</a><span class="member"><a name="getDriver">getDriver</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The parent driver for this instance.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1708">code »</a><span class="member"><a name="getId">getId</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="class_webdriver_WebElement.html#webdriver.WebElement.Id">webdriver.WebElement.Id</a>></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise
|
|
89
89
|
that resolves to this element's JSON representation as defined by the
|
|
90
|
-
WebDriver wire protocol.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
91
|
-
resolved with the element's inner HTML.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
90
|
+
WebDriver wire protocol.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2097">code »</a><span class="member"><a name="getInnerHtml">getInnerHtml</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Schedules a command to retrieve the inner HTML of this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
91
|
+
resolved with the element's inner HTML.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2001">code »</a><span class="member"><a name="getLocation">getLocation</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to compute the location of this element in page space.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that
|
|
92
92
|
will be resolved to the element's location as a
|
|
93
|
-
<code >{x:number, y:number}</code> object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
94
|
-
resolved with the element's outer HTML.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
93
|
+
<code >{x:number, y:number}</code> object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2078">code »</a><span class="member"><a name="getOuterHtml">getOuterHtml</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Schedules a command to retrieve the outer HTML of this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
94
|
+
resolved with the element's outer HTML.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1988">code »</a><span class="member"><a name="getSize">getSize</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a command to compute the size of this element's bounding box, in
|
|
95
95
|
pixels.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A
|
|
96
96
|
promise that will be resolved with the element's size as a
|
|
97
|
-
<code >{width:number, height:number}</code> object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
98
|
-
resolved with the element's tag name.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
97
|
+
<code >{width:number, height:number}</code> object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1900">code »</a><span class="member"><a name="getTagName">getTagName</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Schedules a command to query for the tag/node name of this element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
98
|
+
resolved with the element's tag name.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1974">code »</a><span class="member"><a name="getText">getText</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Get the visible (i.e. not hidden by CSS) innerText of this element, including
|
|
99
99
|
sub-elements, without any leading or trailing whitespace.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
100
|
-
resolved with the element's visible text.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
101
|
-
resolved with whether this element is currently visible on the page.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
100
|
+
resolved with the element's visible text.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2066">code »</a><span class="member"><a name="isDisplayed">isDisplayed</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code></span></div><p>Schedules a command to test whether this element is currently displayed.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
101
|
+
resolved with whether this element is currently visible on the page.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1796">code »</a><span class="member"><a name="isElementPresent">isElementPresent</a> <span class="args">( locator )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code></span></div><p>Schedules a command to test if there is at least one descendant of this
|
|
102
102
|
element that matches the given search criteria.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>locator: <code class="type">!(<a href="class_webdriver_Locator.html">webdriver.Locator</a>|<a href="namespace_webdriver_By.html#webdriver.By.Hash">webdriver.By.Hash</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The
|
|
103
103
|
locator strategy to use when searching for the element.</dl><tr><th>Returns<tr><td><dl>A promise that will be
|
|
104
|
-
resolved with whether an element could be located on the page.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
104
|
+
resolved with whether an element could be located on the page.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2014">code »</a><span class="member"><a name="isEnabled">isEnabled</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code></span></div><p>Schedules a command to query whether the DOM element represented by this
|
|
105
105
|
instance is enabled, as dicted by the <code >disabled</code> attribute.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
106
|
-
resolved with whether this element is currently enabled.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
107
|
-
resolved with whether this element is currently selected.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
106
|
+
resolved with whether this element is currently enabled.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2026">code »</a><span class="member"><a name="isSelected">isSelected</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>></code></span></div><p>Schedules a command to query whether this element is selected.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be
|
|
107
|
+
resolved with whether this element is currently selected.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1725">code »</a><code class="type"><T></code> <span class="member"><a name="schedule_">schedule_</a> <span class="args">( command, description )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<T></code></span></div><p>Schedules a command that targets this element with the parent WebDriver
|
|
108
108
|
instance. Will ensure this element's ID is included in the command parameters
|
|
109
109
|
under the "id" key.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>command: <code class="type">!<a href="class_webdriver_Command.html">webdriver.Command</a></code><dd>The command to schedule.<dt>description: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>A description of the command for debugging.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved
|
|
110
|
-
with the command result.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
110
|
+
with the command result.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1878">code »</a><span class="member"><a name="sendKeys">sendKeys</a> <span class="args">( var_args )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<void></code></span></div><p>Schedules a command to type a sequence on the DOM element represented by this
|
|
111
111
|
instance.
|
|
112
112
|
<p/>
|
|
113
113
|
Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
keyboard layout.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The sequence of keys to
|
|
142
142
|
type. All arguments will be joined into a single sequence (var_args is
|
|
143
143
|
permitted for convenience).</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved
|
|
144
|
-
when all keys have been typed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
144
|
+
when all keys have been typed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l2040">code »</a><span class="member"><a name="submit">submit</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<void></code></span></div><p>Schedules a command to submit the form containing this element (or this
|
|
145
145
|
element if it is a FORM element). This command is a no-op if the element is
|
|
146
146
|
not contained in a form.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A promise that will be resolved
|
|
147
|
-
when the form has been submitted.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type"><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#
|
|
147
|
+
when the form has been submitted.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type"><a href="class_webdriver_WebElement.html">webdriver.WebElement</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1640">code »</a><span class="member"><a name="driver_">driver_</a> : <code class="type">!<a href="class_webdriver_WebDriver.html">webdriver.WebDriver</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/webdriver.js.src.html#l1643">code »</a><span class="member"><a name="id_">id_</a> : <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<<a href="class_webdriver_WebElement.html#webdriver.WebElement.Id">webdriver.WebElement.Id</a>></code></span></div></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/webdriver.js.src.html#l2125">code »</a><span class="member"><a name="webdriver.WebElementPromise.superClass_">webdriver.WebElementPromise.superClass_</a> : <code class="type"><a href="class_webdriver_WebElement.html">webdriver.WebElement.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>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.promise.CancellationError</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.promise.CancellationError</h1><a class="source" href="source/lib/webdriver/promise.js.src.html#l72">code »</a><pre><code><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a>
|
|
2
|
+
└ <a href="class_goog_debug_Error.html">goog.debug.Error</a>
|
|
3
|
+
└ webdriver.promise.CancellationError</code></pre></header><section><p>Error used when the computation of a promise is cancelled.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">webdriver.promise.CancellationError <span class="args">( opt_msg )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_msg: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The cancellation message.</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="static-properties"><h2>Static Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l72">code »</a><span class="member"><a name="webdriver.promise.CancellationError.superClass_">webdriver.promise.CancellationError.superClass_</a> : <code class="type"><a href="class_goog_debug_Error.html">goog.debug.Error.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>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.promise.ControlFlow</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.promise.ControlFlow</h1><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
1
|
+
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.promise.ControlFlow</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.promise.ControlFlow</h1><a class="source" href="source/lib/webdriver/promise.js.src.html#l1048">code »</a><pre><code><a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a>
|
|
2
2
|
└ webdriver.promise.ControlFlow</code></pre></header><section><p>Handles the execution of scheduled tasks, each of which may be an
|
|
3
3
|
asynchronous operation. The control flow will ensure tasks are executed in
|
|
4
4
|
the ordered scheduled, starting each task only once those before it have
|
|
@@ -23,46 +23,46 @@
|
|
|
23
23
|
<code class="type"><a href="enum_webdriver_promise_ControlFlow_EventType.html#webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION">webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION</a></code> event. If
|
|
24
24
|
there are no listeners registered with the flow, the error will be
|
|
25
25
|
rethrown to the global error handler.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">webdriver.promise.ControlFlow <span class="args">( opt_timer )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_timer: <code class="type"><a href="class_webdriver_promise_ControlFlow.html#webdriver.promise.ControlFlow.Timer">webdriver.promise.ControlFlow.Timer</a>=</code><dd>The timer object
|
|
26
|
-
to use. Should only be set for testing.</dl></table></div></div></div></section><section><h2>Enumerations</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="enum_webdriver_promise_ControlFlow_EventType.html">webdriver.promise.ControlFlow.EventType</a><dd>Events that may be emitted by an <code class="type"><a href="class_webdriver_promise_ControlFlow.html">webdriver.promise.ControlFlow</a></code>.</dl></table></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="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
26
|
+
to use. Should only be set for testing.</dl></table></div></div></div></section><section><h2>Enumerations</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="enum_webdriver_promise_ControlFlow_EventType.html">webdriver.promise.ControlFlow.EventType</a><dd>Events that may be emitted by an <code class="type"><a href="class_webdriver_promise_ControlFlow.html">webdriver.promise.ControlFlow</a></code>.</dl></table></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="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1144">code »</a><a class="member" name="webdriver.promise.ControlFlow.Timer">webdriver.promise.ControlFlow.Timer</a> : <code class="type">{clearInterval: function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>), clearTimeout: function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>), setInterval: function(!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, setTimeout: function(!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>}</code></div><div>No description.</div></summary></details></div></div></section><section id="instance-methods"><h2>Instance Methods</h2><h3>Defined in <code class="type">webdriver.promise.ControlFlow</code></h3><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1591">code »</a><span class="member"><a name="abortFrame_">abortFrame_</a> <span class="args">( error )</span></span></div><p>Aborts the current frame. The frame, and all of the tasks scheduled within it
|
|
27
27
|
will be discarded. If this instance does not have an active frame, it will
|
|
28
28
|
immediately terminate all execution.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>error: <code class="type">*</code><dd>The reason the frame is being aborted; typically either
|
|
29
|
-
an Error or string.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
29
|
+
an Error or string.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1752">code »</a><span class="member"><a name="abortNow_">abortNow_</a> <span class="args">( error )</span></span></div><p>Aborts this flow, abandoning all remaining tasks. If there are
|
|
30
30
|
listeners registered, an <code >UNCAUGHT_EXCEPTION</code> will be emitted with the
|
|
31
31
|
offending <code >error</code>, otherwise, the <code >error</code> will be rethrown to the
|
|
32
32
|
global error handler.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>error: <code class="type">*</code><dd>Object describing the error that caused the flow to
|
|
33
|
-
abort; usually either an Error or string value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
33
|
+
abort; usually either an Error or string value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1288">code »</a><span class="member"><a name="annotateError">annotateError</a> <span class="args">( e )</span> ⇒ <code class="type">!(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a>|<a href="class_goog_testing_JsUnitException.html">goog.testing.JsUnitException</a>)</code></span></div><p>Appends a summary of this instance's recent task history to the given
|
|
34
34
|
error's stack trace. This function will also ensure the error's stack trace
|
|
35
|
-
is in canonical form.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>e: <code class="type">!(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a>|<a href="class_goog_testing_JsUnitException.html">goog.testing.JsUnitException</a>)</code><dd>The error to annotate.</dl><tr><th>Returns<tr><td><dl>The annotated error.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
35
|
+
is in canonical form.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>e: <code class="type">!(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a>|<a href="class_goog_testing_JsUnitException.html">goog.testing.JsUnitException</a>)</code><dd>The error to annotate.</dl><tr><th>Returns<tr><td><dl>The annotated error.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1443">code »</a><span class="member"><a name="await">await</a> <span class="args">( promise )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Schedules a task that will wait for another promise to resolve. The resolved
|
|
36
36
|
promise's value will be returned as the task result.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>promise: <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code><dd>The promise to wait on.</dl><tr><th>Returns<tr><td><dl>A promise that will resolve when the
|
|
37
|
-
task has completed.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
37
|
+
task has completed.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1467">code »</a><span class="member"><a name="cancelEventLoop_">cancelEventLoop_</a> <span class="args">( )</span></span></div><p>Cancels the event loop, if necessary.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1735">code »</a><span class="member"><a name="cancelShutdown_">cancelShutdown_</a> <span class="args">( )</span></span></div><p>Cancels the shutdown sequence if it is currently scheduled.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1250">code »</a><span class="member"><a name="clearHistory">clearHistory</a> <span class="args">( )</span></span></div><p>Clears this instance's task history.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1712">code »</a><span class="member"><a name="commenceShutdown_">commenceShutdown_</a> <span class="args">( )</span></span></div><p>Commences the shutdown sequence for this instance. After one turn of the
|
|
38
38
|
event loop, this object will emit the
|
|
39
39
|
<code class="type"><a href="enum_webdriver_promise_ControlFlow_EventType.html#webdriver.promise.ControlFlow.EventType.IDLE">webdriver.promise.ControlFlow.EventType.IDLE</a></code> event to signal
|
|
40
40
|
listeners that it has completed. During this wait, if another task is
|
|
41
|
-
scheduled, the shutdown will be aborted.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
41
|
+
scheduled, the shutdown will be aborted.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1332">code »</a><code class="type"><T></code> <span class="member"><a name="execute">execute</a> <span class="args">( fn, opt_description )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<T></code></span></div><p>Schedules a task for execution. If there is nothing currently in the
|
|
42
42
|
queue, the task will be executed in the next turn of the event loop. If
|
|
43
43
|
the task function is a generator, the task will be executed using
|
|
44
44
|
<code class="type"><a href="namespace_webdriver_promise.html#webdriver.promise.consume">webdriver.promise.consume</a></code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fn: <code class="type">function(): (T|<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<T>)</code><dd>The function to
|
|
45
45
|
call to start the task. If the function returns a
|
|
46
46
|
<code class="type"><a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code>, this instance will wait for it to be
|
|
47
47
|
resolved before starting the next task.<dt>opt_description: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>A description of the task.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved
|
|
48
|
-
with the result of the action.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
48
|
+
with the result of the action.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1229">code »</a><span class="member"><a name="getHistory">getHistory</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="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Returns a summary of the recent task activity for this instance. This
|
|
49
49
|
includes the most recently completed task, as well as any parent tasks. In
|
|
50
50
|
the returned summary, the task at index N is considered a sub-task of the
|
|
51
51
|
task at index N+1.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>A summary of this instance's recent task
|
|
52
|
-
activity.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
53
|
-
<code >null</code> if a frame was resolved.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
52
|
+
activity.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1539">code »</a><span class="member"><a name="getNextTask_">getNextTask_</a> <span class="args">( )</span> ⇒ <code class="type"><a href="class_webdriver_promise_Task_.html">webdriver.promise.Task_</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The next task to execute, or
|
|
53
|
+
<code >null</code> if a frame was resolved.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1312">code »</a><span class="member"><a name="getSchedule">getSchedule</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 scheduled tasks still pending with this instance.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1211">code »</a><span class="member"><a name="reset">reset</a> <span class="args">( )</span></span></div><p>Resets this instance, clearing its queue and removing all event listeners.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1563">code »</a><span class="member"><a name="resolveFrame_">resolveFrame_</a> <span class="args">( frame )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>frame: <code class="type">!<a href="class_webdriver_promise_Frame_.html">webdriver.promise.Frame_</a></code><dd>The frame to resolve.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1482">code »</a><span class="member"><a name="runEventLoop_">runEventLoop_</a> <span class="args">( )</span></span></div><p>Executes the next task for the current frame. If the current frame has no
|
|
54
54
|
more tasks, the frame's result will be resolved, returning control to the
|
|
55
55
|
frame's creator. This will terminate the flow if the completed frame was at
|
|
56
|
-
the top of the stack.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
56
|
+
the top of the stack.</summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1632">code »</a><span class="member"><a name="runInNewFrame_">runInNewFrame_</a> <span class="args">( fn, callback, errback, opt_activate )</span></span></div><p>Executes a function in a new frame. If the function does not schedule any new
|
|
57
57
|
tasks, the frame will be discarded and the function's result returned
|
|
58
58
|
immediately. Otherwise, a promise will be returned. This promise will be
|
|
59
59
|
resolved with the function's result once all of the tasks scheduled within
|
|
60
60
|
the function have been completed. If the function's frame is aborted, the
|
|
61
61
|
returned promise will be rejected.</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 execute.<dt>callback: <code class="type">function(*)</code><dd>The function to call with a successful result.<dt>errback: <code class="type">function(*)</code><dd>The function to call if there is an error.<dt>opt_activate: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether the active frame should be updated to
|
|
62
|
-
the newly created frame so tasks are treated as sub-tasks.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
62
|
+
the newly created frame so tasks are treated as sub-tasks.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1454">code »</a><span class="member"><a name="scheduleEventLoopStart_">scheduleEventLoopStart_</a> <span class="args">( )</span></span></div><p>Schedules the interval for this instance's event loop, if necessary.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1368">code »</a><span class="member"><a name="timeout">timeout</a> <span class="args">( ms, opt_description )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a></code></span></div><p>Inserts a <code >setTimeout</code> into the command queue. This is equivalent to
|
|
63
63
|
a thread sleep in a synchronous programming language.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>ms: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The timeout delay, in milliseconds.<dt>opt_description: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>A description to accompany the timeout.</dl><tr><th>Returns<tr><td><dl>A promise that will be resolved with
|
|
64
|
-
the result of the action.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
65
|
-
tasks remain from aborted frames, those will be removed as well.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
64
|
+
the result of the action.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1260">code »</a><span class="member"><a name="trimHistory_">trimHistory_</a> <span class="args">( )</span></span></div><p>Removes a completed task from this instance's history record. If any
|
|
65
|
+
tasks remain from aborted frames, those will be removed as well.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1401">code »</a><code class="type"><T></code> <span class="member"><a name="wait">wait</a> <span class="args">( condition, timeout, opt_message )</span> ⇒ <code class="type">!<a href="class_webdriver_promise_Promise.html">webdriver.promise.Promise</a>.<T></code></span></div><p>Schedules a task that shall wait for a condition to hold. Each condition
|
|
66
66
|
function may return any value, but it will always be evaluated as a boolean.
|
|
67
67
|
|
|
68
68
|
<p>Condition functions may schedule sub-tasks with this instance, however,
|
|
@@ -74,35 +74,35 @@
|
|
|
74
74
|
out.
|
|
75
75
|
|
|
76
76
|
<p>If the condition function throws, or returns a rejected promise, the
|
|
77
|
-
wait task will fail.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>condition: <code class="type"
|
|
77
|
+
wait task will fail.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>condition: <code class="type">function(): T</code><dd>The condition function to poll.<dt>timeout: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>How long to wait, in milliseconds, for the condition
|
|
78
78
|
to hold before timing out.<dt>opt_message: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>An optional error message to include if the
|
|
79
|
-
wait times out; defaults to the empty string.</dl><tr><th>Returns<tr><td><dl>A promise that will be
|
|
80
|
-
condition has been satisified. The promise shall be rejected if
|
|
81
|
-
times out waiting for the condition.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l116">code »</a><span class="member"><a name="addListener">addListener</a> <span class="args">( type, listenerFn, opt_scope )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Registers a listener.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to listen for.<dt>listenerFn: <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 invoke when the event is fired.<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>The object in whose scope to invoke the listener.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l90">code »</a><span class="member"><a name="addListener_">addListener_</a> <span class="args">( type, listenerFn, opt_scope, opt_oneshot )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Registers a listener.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to listen for.<dt>listenerFn: <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 invoke when the event is fired.<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>The object in whose scope to invoke the listener.<dt>opt_oneshot: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether the listener should be removed after
|
|
79
|
+
wait times out; defaults to the empty string.</dl><tr><th>Returns<tr><td><dl>A promise that will be fulfilled
|
|
80
|
+
when the condition has been satisified. The promise shall be rejected if
|
|
81
|
+
the wait times out waiting for the condition.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l116">code »</a><span class="member"><a name="addListener">addListener</a> <span class="args">( type, listenerFn, opt_scope )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Registers a listener.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to listen for.<dt>listenerFn: <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 invoke when the event is fired.<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>The object in whose scope to invoke the listener.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l90">code »</a><span class="member"><a name="addListener_">addListener_</a> <span class="args">( type, listenerFn, opt_scope, opt_oneshot )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Registers a listener.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to listen for.<dt>listenerFn: <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 invoke when the event is fired.<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>The object in whose scope to invoke the listener.<dt>opt_oneshot: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether the listener should be removed after
|
|
82
82
|
the first event is fired.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l44">code »</a><span class="member"><a name="emit">emit</a> <span class="args">( type, var_args )</span></span></div><p>Fires an event and calls all listeners.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to emit.<dt>var_args: <code class="type">...*</code><dd>Any arguments to pass to each listener.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l71">code »</a><span class="member"><a name="listeners">listeners</a> <span class="args">( type )</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>Returns a mutable list of listeners for a specific type of event.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to retrieve the listeners for.</dl><tr><th>Returns<tr><td><dl>The registered listeners for
|
|
83
83
|
the given event type.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l142">code »</a><span class="member"><a name="on">on</a> <span class="args">( type, listenerFn, opt_scope )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>An alias for <code >#addListener()</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to listen for.<dt>listenerFn: <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 invoke when the event is fired.<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>The object in whose scope to invoke the listener.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l130">code »</a><span class="member"><a name="once">once</a> <span class="args">( type, listenerFn, opt_scope )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Registers a one-time listener which will be called only the first time an
|
|
84
84
|
event is emitted, after which it will be removed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to listen for.<dt>listenerFn: <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 invoke when the event is fired.<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>The object in whose scope to invoke the listener.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l173">code »</a><span class="member"><a name="removeAllListeners">removeAllListeners</a> <span class="args">( opt_type )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Removes all listeners for a specific type of event. If no event is
|
|
85
|
-
specified, all listeners across all types will be removed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The type of event to remove listeners from.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l152">code »</a><span class="member"><a name="removeListener">removeListener</a> <span class="args">( type, listenerFn )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Removes a previously registered event listener.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to unregister.<dt>listenerFn: <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The handler function to remove.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">webdriver.promise.ControlFlow</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
86
|
-
when the first task is scheduled.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
85
|
+
specified, all listeners across all types will be removed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The type of event to remove listeners from.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l152">code »</a><span class="member"><a name="removeListener">removeListener</a> <span class="args">( type, listenerFn )</span> ⇒ <code class="type">!<a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></span></div><p>Removes a previously registered event listener.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The type of event to unregister.<dt>listenerFn: <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The handler function to remove.</dl><tr><th>Returns<tr><td><dl>A self reference.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">webdriver.promise.ControlFlow</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1071">code »</a><span class="member"><a name="activeFrame_">activeFrame_</a> : <code class="type"><a href="class_webdriver_promise_Frame_.html">webdriver.promise.Frame_</a></code></span></div><p>Tracks the active execution frame for this instance. Lazily initialized
|
|
86
|
+
when the first task is scheduled.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1108">code »</a><span class="member"><a name="eventLoopId_">eventLoopId_</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>Interval ID for this instance's event loop.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1064">code »</a><span class="member"><a name="history_">history_</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>A list of recent tasks. Each time a new task is started, or a frame is
|
|
87
87
|
completed, the previously recorded task is removed from this list. If
|
|
88
88
|
there are multiple tasks, task N+1 is considered a sub-task of task
|
|
89
|
-
N.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
90
|
-
frame completed successfully.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
89
|
+
N.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1133">code »</a><span class="member"><a name="numAbortedFrames_">numAbortedFrames_</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>The number of aborted frames since the last time a task was executed or a
|
|
90
|
+
frame completed successfully.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1126">code »</a><span class="member"><a name="pendingRejections_">pendingRejections_</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>The number of "pending" promise rejections.
|
|
91
91
|
|
|
92
|
-
<p>Each time a promise is rejected and is not handled by a listener, it
|
|
93
|
-
schedule a 0-based timeout to check if it is still unrejected in the
|
|
94
|
-
turn of the JS-event loop. This allows listeners to attach to, and
|
|
95
|
-
the rejected promise at any point in same turn of the event loop
|
|
96
|
-
promise was rejected.
|
|
92
|
+
<p>Each time a promise is rejected and is not handled by a listener, it
|
|
93
|
+
will schedule a 0-based timeout to check if it is still unrejected in the
|
|
94
|
+
next turn of the JS-event loop. This allows listeners to attach to, and
|
|
95
|
+
handle, the rejected promise at any point in same turn of the event loop
|
|
96
|
+
that the promise was rejected.
|
|
97
97
|
|
|
98
98
|
<p>When this flow's own event loop triggers, it will not run if there
|
|
99
99
|
are any outstanding promise rejections. This allows unhandled promises to
|
|
100
|
-
be reported before a new task is started, ensuring the error is reported
|
|
101
|
-
the current task queue.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
100
|
+
be reported before a new task is started, ensuring the error is reported
|
|
101
|
+
to the current task queue.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1082">code »</a><span class="member"><a name="schedulingFrame_">schedulingFrame_</a> : <code class="type"><a href="class_webdriver_promise_Frame_.html">webdriver.promise.Frame_</a></code></span></div><p>A reference to the frame in which new tasks should be scheduled. If
|
|
102
102
|
<code >null</code>, tasks will be scheduled within the active frame. When forcing
|
|
103
103
|
a function to run in the context of a new frame, this pointer is used to
|
|
104
104
|
ensure tasks are scheduled within the newly created frame, even though it
|
|
105
|
-
won't be active yet.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
105
|
+
won't be active yet.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1102">code »</a><span class="member"><a name="shutdownId_">shutdownId_</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>Timeout ID set when the flow is about to shutdown without any errors
|
|
106
106
|
being detected. Upon shutting down, the flow will emit an
|
|
107
107
|
<code class="type"><a href="enum_webdriver_promise_ControlFlow_EventType.html#webdriver.promise.ControlFlow.EventType.IDLE">webdriver.promise.ControlFlow.EventType.IDLE</a></code> event. Idle events
|
|
108
108
|
always follow a brief timeout in order to catch latent errors from the last
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
function() { return webdriver.promise.rejected('failed'); });
|
|
116
116
|
// Set a callback on the result. This delays reporting the unhandled
|
|
117
117
|
// failure for 1 turn of the event loop.
|
|
118
|
-
result.then(goog.nullFunction);</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
119
|
-
<code class="type"><a href="class_webdriver_promise_ControlFlow.html#annotateError">webdriver.promise.ControlFlow#annotateError</a></code>.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#
|
|
118
|
+
result.then(goog.nullFunction);</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1055">code »</a><span class="member"><a name="timer">timer</a> : <code class="type"><a href="class_webdriver_promise_ControlFlow.html#webdriver.promise.ControlFlow.Timer">webdriver.promise.ControlFlow.Timer</a></code></span></div><p>The timer used by this instance.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/events.js.src.html#l35">code »</a><span class="member"><a name="events_">events_</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>Map of events to registered listeners.</summary></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1277">code »</a><span class="member"><a name="webdriver.promise.ControlFlow.ANNOTATION_PROPERTY_">webdriver.promise.ControlFlow.ANNOTATION_PROPERTY_</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>Property used to track whether an error has been annotated by
|
|
119
|
+
<code class="type"><a href="class_webdriver_promise_ControlFlow.html#annotateError">webdriver.promise.ControlFlow#annotateError</a></code>.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1205">code »</a><span class="member"><a name="webdriver.promise.ControlFlow.EVENT_LOOP_FREQUENCY">webdriver.promise.ControlFlow.EVENT_LOOP_FREQUENCY</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>How often, in milliseconds, the event loop should run.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1151">code »</a><span class="member"><a name="webdriver.promise.ControlFlow.defaultTimer">webdriver.promise.ControlFlow.defaultTimer</a> : <code class="type"><a href="class_webdriver_promise_ControlFlow.html#webdriver.promise.ControlFlow.Timer">webdriver.promise.ControlFlow.Timer</a></code></span></div><p>The default timer object, which uses the global timer functions.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1048">code »</a><span class="member"><a name="webdriver.promise.ControlFlow.superClass_">webdriver.promise.ControlFlow.superClass_</a> : <code class="type"><a href="class_webdriver_EventEmitter.html">webdriver.EventEmitter.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>
|