Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 178 additions & 1 deletion 03_capabilities.html
Original file line number Diff line number Diff line change
@@ -1 +1,178 @@
<!-- Section removed as it was describing specific local end implementations -->
<section>
<h2>Capabilities</h2>
<p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Webdriver/WebDriver

WebDriver <dfn>capabilities</dfn> allow the <a>local end</a> to specify what
features it requires the <a>remote end</a> to fulfil to be able to create a
<a>new session</a>
</p>
<h3>Processing Capabilities</h3>
<p>
<p>When <dfn>processng capabilities</dfn> with argument <var>parameters</var> a
<a>remote end</a> must run the following steps:</p>
<ol>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call these just “capabilities” and call the parameter passed in “desired capabilities” or something similar.

<li><p>Let <var>server capabilities</var> be a JSON Object with the following entries:<p></li>
<ol>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit superfluous to say “Let foo be an entry” when the outer step says “… with the following entries:”. This can just be a list, like:

<li><p><code>"browserName"</code>: Lower-cased name of the user agent.</p></li>

<li><p><code>browserName</code>: the lowercase name of the user agent</p></li>
<li><p><code>browserVersion</code>: the version of the user agent<p></li>
<li><p><code>platformName</code>: the lowercase name of the platform.</p></li>
<li><p><code>platformVersion</code>: the version of the platform</p></li>
<li><p><code>acceptSslCerts</code>: be true if the User Agent can handle
<a href='#invalid-ssl-certificates'>Invalid SSL Certifications</a> else let it be equal to
false.</p></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided that all remote ends must support screenshots.

<li><p><code>takesScreenshot</code>: be true if it can capture
a screenshot of the viewport described in <a>Take Screenshot</a>.</p></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't do element screenshots anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<li><p><code>takesElementScreenshot</code>: be true if it can capture
a screenshot of an element as described in <a>Take Screenshot</a>.</p></li>
</ol>
<li><p>let <var>required capabilities</var> be the result of <a>getting a property</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"<code>requiredCapabilities</code>"

name <code>required capabilities</code> from <var>capabilities</var>.</p></li>
<li><p>let <var>desired capabilities</var> be the result of <a>getting a property</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"<code>desiredCapabilities</code>"

name <code>desired capabilities</code> from <var>capabilities</var>.</p></li>
<li><p>If <var>required capabilities</var> is undefined and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will never reach this if getting the property off capabilities fails in the first place. The JSON parser would error because there's no such key.

<var>desired capabilities</var> is undefined, go to the last step of this algorithm.</p></li>
<li><p>Let <var>length</var> be the length of <var>required capabilities</var>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required capabilities will always be defined at this point.

Also I still feel that this way of defining iteration can be left as an exercise to the reader and that it distracts the reading of the specification more than it helps its understanding.

if <var>required capabilities</var> is defined else let it be 0.</p></li>
<li><p>Let <var>k</var> be 0</p></li>
<li><p>While <var>k</var> &lt; <var>length</var>:</p>
<ol>
<li><p>Let <var>capability</var> be the value in <var>required capabilities</var> at index <var>k</var>.</p></li>
<li><p>If the name of the <var>capability</var> entry is in <var>desired capabilities</var>
remove the entry from <var>desired capabilities</var>.</p>
</li>
<li>Increase <var>k</var> by 1.</li>
</ol>
</li>
<li><p>Let <var>unmet capabilities</var> be equal to an empty JSON List.</p></li>
<li>
<p>Let <var>unprocessed capabilities</var> be a JSON List that contains <var>required
capabilities</var> if defined and <var>desired capabilities</var> if defined.</p>
</li>
<li>
<p>Let <var>j</var> be 0</p>
</li>
<li>
<p>Let <var>capabilties length</var> be the length of <var>unprocessed capabilities</var>.</p>
</li>
<li>
<p>While <var>j</var> &lt; <var>capabilities length</var>:
<ol>
<li>
<p>
Let <var>unprocessed capability</var> be the entry at index <var>j</var> in <var>unprocessed
capabilities</var>.
</p>
</li>
<li>
<p>Let <var>browser name</var> be the result of <a>getting a property</a>
named "browserName" from <var>caps</var>. If <var>browser name</var>
is undefined move to the next step. If <var>unprocessed capability</var> equals <var>required
capabilities</var> do the following:</p>
<ol>
<li>
<p>
If <var>browser name</var> is defined
and is not equal to "browserName" from <var>server capabilities</var> append a string
containing the differences between <var>browser name</var> and "browserName"
in <var>server capabilities</var>.
</p>
</li>
</ol>
</li>
<li>
<p>Let <var>browser version</var> be the result of <a>getting a property</a>
named "browserVersion" from <var>caps</var>. If <var>browser name</var>
is undefined move to the next step.
If <var>unprocessed capability</var> equals <var>required capabilities</var> do the following:</p>
<ol>
<li>
<p>If <var>browser name</var> is defined
and is not equal to "browserVersion" from <var>server capabilities</var> append a string
containing the differences between <var>browser version</var> and "browserVersion"
in <var>server capabilities</var>.
</p>
</li>
</ol>
</li>
<li>
<p>Let <var>platform name</var> be the result of <a>getting a property</a>
named "platformName" from <var>caps</var>. If <var>platform name</var>
is undefined move to the next step.
If <var>unprocessed capability</var> equals <var>required capabilities</var> do the following:</p>
<ol>
<li>
<p>If <var>platform name</var> is defined
and is not equal to "platformName" from <var>server capabilities</var> append a string
containing the differences between <var>browser name</var> and "platformName"
in <var>server capabilities</var>.
</p>
</li>
</ol>
</li>
<li>
<p>Let <var>platform version</var> be the result of <a>getting a property</a>
named "platformVersion" from <var>caps</var>. If <var>platform version</var>
is undefined move to the next step.
If <var>unprocessed capability</var> equals <var>required capabilities</var> do the following:</p>
<ol>
<li>
<p>If <var>platform version</var> is defined
and is not equal to "platformVersion" from <var>server capabilities</var> append a string
containing the differences between <var>platform version</var> and "platformVersion"
in <var>server capabilities</var>.
</p>
</li>
</ol>
</li>
<li>
<p>Let <var>proxy</var> be the result of <a>getting a property</a>
named "proxy" from <var>caps</var>. If <var>proxy</var>
is undefined move to the next step. If <var>proxy</var> is defined and not a map
append a string saying that a map is required else call <a>setup proxy</a><!-- TODO (David) define setup proxy-->
passing in <var>proxy</var>.
If <var>unprocessed capability</var> equals <var>required capabilities</var> do the following:</p>
<ol>
<li>
<p>If any errors are returned from <a>setup proxy</a>
append to <var>unmet capabilities</var> else set the entry "proxy" in <var>server
capabilities</var> to the value in <var>proxy</var>.
</p>
</li>
</ol>
</li>
<li>
<p>Let <var>page load strategy</var> be the result of <a>getting a property</a>
named "pageLoadStrategy" from <var>caps</var>. If <var>page load strategy</var>
is undefined then set the entry "pageLoadStrategy" in <var>server capabilities</var> to <a>normal</a>.
If <var>unprocessed capability</var> equals <var>required capabilities</var> do the following:</p>
<ol>
<li>
<p>If <var>page load strategy</var> is defined and not equal to <a>normal</a>, <a>eager</a> and <a>none</a>
then append a string saying that it contains an invalid value else set the entry
"pageLoadStrategy" in <var>server capabilities</var> to the value in <var>page load
strategy</var>.
</p>
</li>
</ol>
<p>
If <var>unprocessed capability</var> equals <var>desired capabilities</var>:
</p>
<ol>
<li>
<p>
If <var>page load strategy</var> is defined and not equal to <a>normal</a>, <a>eager</a> and <a>none</a>
then set the entry "pageLoadStrategy" in <var>server capabilities</var> to <a>normal</a>..
</p>
</li>
</ol>
</li>
</ol>
</p>
</li>
<li>
<p>If the length of <var>unmet capabilities</var> is not equal to 0 return
<a>session not created</a> with data <var>unmet capabilities</var>.</p>
</li>
<li><p>Return <var>server capabilities</var></p></li>
</ol>
</p>
</section>
13 changes: 0 additions & 13 deletions 04_sessions.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,6 @@ <h3>New Session</h3>
</li>
</ol>
</section>
<section>
<h3>Remote End Matching of Capabilities</h3>
<p>This section is non-normative.</p>
<p>The suggested order for comparing keys in the <a>Capabilities</a> instance when creating a session is:</p>
<ol>
<li>browserName</li>
<li>browserVersion</li>
<li>platformName</li>
<li>platformVersion</li>
</ol>
<p>For all comparisons, if the key is missing (as determined by a call to Capability.has() returning "false"), that particular criteria shall not factor into the
comparison.</p>
</section>
<section>
<h3>Removing a Session</h3>
<p><table class="simple jsoncommand">
Expand Down
Loading