UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

59 lines (55 loc) 19.3 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>webdriver.promise.Frame_</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.Frame_</h1><a class="source" href="source/lib/webdriver/promise.js.src.html#l1818">code &raquo;</a><pre><code>webdriver.promise.Promise.&lt;(T|null)&gt; &#x2514; <a href="class_webdriver_promise_Deferred.html">webdriver.promise.Deferred</a> &#x2514; <a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a> &#x2514; webdriver.promise.Frame_</code></pre><dl><dt>All implemented interfaces:<dd><code><a href="">webdriver.promise.Thenable.&lt;(T|null)&gt;</a></code></dl></header><section><p>An execution frame within a <code class="type"><a href="class_webdriver_promise_ControlFlow.html">webdriver.promise.ControlFlow</a></code>. Each frame represents the execution context for either a <code class="type"><a href="class_webdriver_promise_Task_.html">webdriver.promise.Task_</a></code> or a callback on a <code class="type"><a href="class_webdriver_promise_Deferred.html">webdriver.promise.Deferred</a></code>. <p>Each frame may contain sub-frames. If child N is a sub-frame, then the items queued within it are given priority over child N+1.<h2>Constructor</h2><div class="ctor wrap-details private"><div><div class="ctor"><span class="member">webdriver.promise.Frame_ <span class="args">( flow )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>flow: <code class="type">!<a href="class_webdriver_promise_ControlFlow.html">webdriver.promise.ControlFlow</a></code><dd>The flow this instance belongs to.</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.promise.Frame_</code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1955">code &raquo;</a><span class="member"><a name="addChild">addChild</a> <span class="args">( node )</span></span></div><p>Adds a new node to this frame.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>node: <code class="type">!(<a href="class_webdriver_promise_Frame_.html">webdriver.promise.Frame_</a>|<a href="class_webdriver_promise_Task_.html">webdriver.promise.Task_</a>)</code><dd>The node to insert.</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#l1910">code &raquo;</a><span class="member"><a name="cancelRemainingTasks">cancelRemainingTasks</a> <span class="args">( error )</span></span></div><p>Marks all of the tasks that are descendants of this frame in the execution tree as cancelled. This is necessary for callbacks scheduled asynchronous. For example: var someResult; webdriver.promise.createFlow(function(flow) { someResult = flow.execute(function() {}); throw Error(); }).addErrback(function(err) { console.log('flow failed: ' + err); someResult.then(function() { console.log('task succeeded!'); }, function(err) { console.log('task failed! ' + err); }); }); // flow failed: Error: boom // task failed! CanceledTaskError: Task discarded due to a previous // task failure: Error: boom</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>error: <code class="type">!<a href="class_webdriver_promise_CanceledTaskError_.html">webdriver.promise.CanceledTaskError_</a></code><dd>The cancellation 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#l1985">code &raquo;</a><span class="member"><a name="getFirstChild">getFirstChild</a> <span class="args">( )</span> &rArr; <code class="type">(<a href="class_webdriver_promise_Frame_.html">webdriver.promise.Frame_</a>|<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>This frame's fist child.</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#l1930">code &raquo;</a><span class="member"><a name="getPendingTask">getPendingTask</a> <span class="args">( )</span> &rArr; <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 task currently executing within this frame, if any.</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#l1945">code &raquo;</a><span class="member"><a name="lockFrame">lockFrame</a> <span class="args">( )</span></span></div><p>Locks this frame.</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#l1825">code &raquo;</a><span class="member"><a name="reject">reject</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/promise.js.src.html#l1997">code &raquo;</a><span class="member"><a name="removeChild">removeChild</a> <span class="args">( child )</span></span></div><p>Removes a child from this frame.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>child: <code class="type">!(<a href="class_webdriver_promise_Frame_.html">webdriver.promise.Frame_</a>|<a href="class_webdriver_promise_Task_.html">webdriver.promise.Task_</a>)</code><dd>The child to remove.</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#l1939">code &raquo;</a><span class="member"><a name="setPendingTask">setPendingTask</a> <span class="args">( task )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>task: <code class="type"><a href="class_webdriver_promise_Task_.html">webdriver.promise.Task_</a></code><dd>The task currently executing within this frame, if any.</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#l2008">code &raquo;</a><span class="member"><a name="toString">toString</a> <span class="args">( )</span> &rArr; <code class="type">string</code></span></div></summary></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1777">code &raquo;</a><span class="member"><a name="getParent">getParent</a> <span class="args">( )</span> &rArr; <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>This node's parent.</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#l1793">code &raquo;</a><span class="member"><a name="getRoot">getRoot</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The root of this node's tree.</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#l1785">code &raquo;</a><span class="member"><a name="setParent">setParent</a> <span class="args">( parent )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>parent: <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code><dd>This node's new parent.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_promise_Deferred.html">webdriver.promise.Deferred</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l547">code &raquo;</a><span class="member"><a name="errback">errback</a> <span class="args">( opt_error )</span></span></div><p>Rejects this promise. If the error is itself a promise, this instance will be chained to it and be rejected with the error's resolved value.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_error: <code class="type">*=</code><dd>The rejection reason, typically either a <code >Error</code> or a <code >string</code>.</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#l546">code &raquo;</a><span class="member"><a name="fulfill">fulfill</a> <span class="args">( opt_value )</span></span></div><p>Resolves this promise with the given value. If the value is itself a promise and not a reference to this deferred, this instance will wait for it before resolving.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_value: <code class="type">T=</code><dd>The fulfilled 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#l552">code &raquo;</a><span class="member"><a name="removeAll">removeAll</a> <span class="args">( )</span></span></div><p>Removes all of the listeners previously registered on this deferred.</summary><div class="info"><table><tbody><tr><th>Throws<tr><td><dl><dt><code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a></code><dd>If this deferred has already been resolved.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_promise_Promise.html#webdriver.promise.Promise.&lt;(T|null)&gt;">webdriver.promise.Promise.&lt;(T|null)&gt;</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l246">code &raquo;</a><span class="member"><a name="cancel">cancel</a> <span class="args">( reason )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>reason</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#l252">code &raquo;</a><span class="member"><a name="isPending">isPending</a> <span class="args">( )</span> &rArr; <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/promise.js.src.html#l258">code &raquo;</a><span class="member"><a name="then">then</a> <span class="args">( opt_callback, opt_errback )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_callback<dt>opt_errback</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#l265">code &raquo;</a><span class="member"><a name="thenCatch">thenCatch</a> <span class="args">( errback )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>errback</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#l271">code &raquo;</a><span class="member"><a name="thenFinally">thenFinally</a> <span class="args">( callback )</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>callback</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">webdriver.promise.Frame_</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1833">code &raquo;</a><span class="member"><a name="children_">children_</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1863">code &raquo;</a><span class="member"><a name="isActive_">isActive_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether this frame is active. A frame is considered active once one of its descendants has been removed for execution. Adding a sub-frame as a child to an active frame is an indication that a callback to a <code class="type"><a href="class_webdriver_promise_Deferred.html">webdriver.promise.Deferred</a></code> is being invoked and any tasks scheduled within it should have priority over previously scheduled tasks: <code><pre> var flow = webdriver.promise.controlFlow(); flow.execute('start here', goog.nullFunction).then(function() { flow.execute('this should execute 2nd', goog.nullFunction); }); flow.execute('this should execute last', goog.nullFunction); </pre></code></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1876">code &raquo;</a><span class="member"><a name="isLocked_">isLocked_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether this frame is currently locked. A locked frame represents a callback or task function which has run to completion and scheduled all of its tasks. <p>Once a frame becomes <code class="type"><a class="unresolved-link">active</a></code>, any new frames which are added represent callbacks on a <code class="type"><a href="class_webdriver_promise_Deferred.html">webdriver.promise.Deferred</a></code>, whose tasks must be given priority over previously scheduled tasks.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1883">code &raquo;</a><span class="member"><a name="lastInsertedChild_">lastInsertedChild_</a> : <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code></span></div><p>A reference to the last node inserted in this frame.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1842">code &raquo;</a><span class="member"><a name="pendingTask_">pendingTask_</a> : <code class="type"><a href="class_webdriver_promise_Task_.html">webdriver.promise.Task_</a></code></span></div><p>The task currently being executed within this frame.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l1773">code &raquo;</a><span class="member"><a name="parent_">parent_</a> : <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_</a></code></span></div><p>This node's parent.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_webdriver_promise_Deferred.html">webdriver.promise.Deferred</a></code></h3><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/webdriver/promise.js.src.html#l542">code &raquo;</a><span class="member"><a name="webdriver.promise.Deferred.prototype.promise">webdriver.promise.Deferred.prototype.promise</a> : <code class="type">webdriver.promise.Promise.<T></code></span></div><p>Represents the eventual value of a completed operation. Each promise may be in one of three states: pending, resolved, or rejected. Each promise starts in the pending state and may make a single transition to either a fulfilled or rejected state, at which point the promise is considered resolved.</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/promise.js.src.html#l1818">code &raquo;</a><span class="member"><a name="webdriver.promise.Frame_.superClass_">webdriver.promise.Frame_.superClass_</a> : <code class="type"><a href="class_webdriver_promise_Node_.html">webdriver.promise.Node_.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>