-
Notifications
You must be signed in to change notification settings - Fork 209
Documenting the process of handling capabilities #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> | ||
| 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't do element screenshots anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reading http://www.w3.org/2014/10/30-testing-minutes.html#item11 we do still support them |
||
| <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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| name <code>desired capabilities</code> from <var>capabilities</var>.</p></li> | ||
| <li><p>If <var>required capabilities</var> is undefined and | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will never reach this if getting the property off |
||
| <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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> < <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> < <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> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Webdriver/WebDriver