Skip to content

Commit 4c58fec

Browse files
jgrahamshs96c
authored andcommitted
Add hooks for other specs to define WebDriver capabilities.
This adds the concept of "additional webdriver capabilites" which are those defined by other specifications. Each capability has a name and provides validation and (optionaly) matching algorithms to enable to to participate in the capabilities processing steps.
1 parent cebfd28 commit 4c58fec

File tree

1 file changed

+50
-8
lines changed

1 file changed

+50
-8
lines changed

index.html

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,26 @@ <h3>Extensions</h3>
13591359
<a>remote end steps</a>.
13601360
</aside>
13611361

1362+
<p>Other specifications may define <dfn data-lt="additional WebDriver
1363+
capability">additional WebDriver capabilities</dfn>. Each defined
1364+
capability must have a <dfn>capability name</dfn> which is a string
1365+
not containing a "<code>:</code>" (colon) character,
1366+
an <dfn>additional capability deserialization algorithm</dfn> which is
1367+
a set of steps taking a single argument <var>value</var> which has a
1368+
JSON type, returning either <a>success</a> wrapping the deserialized
1369+
capability value or <a>error</a>.
1370+
1371+
<p>An <a>additional WebDriver capability</a> may also define
1372+
a <dfn>matched capability serialization algorithm</dfn>, which is a
1373+
set of steps used to determine if a capability is matched by the
1374+
current implementation and provide any computed value to return to the
1375+
user. This set of steps takes a single argument <var>value</var>,
1376+
which is the output of the corresponding <a>additional capability
1377+
deserialization algorithm</a>, and returns
1378+
either <a><code>null</code></a> to indicate the capability is not
1379+
matched, or a non-null JSON-serializable value if the capability is
1380+
matched.
1381+
13621382
<p><a>Remote ends</a> may also introduce
13631383
<dfn data-lt="extension capability">extension capabilities</dfn>
13641384
that are extra <a>capabilities</a>
@@ -1751,7 +1771,7 @@ <h3>Processing capabilities</h3>
17511771
argument.
17521772

17531773
<li><p>If <var>matched capabilities</var> is not <a><code>null</code></a>,
1754-
return <var>matched capabilities</var>.
1774+
return <a>success</a> with data <var>matched capabilities</var>.
17551775
</ol>
17561776

17571777
<li><p>Return <a>success</a> with data <a><code>null</code></a>.
@@ -1817,6 +1837,14 @@ <h3>Processing capabilities</h3>
18171837
to <a>deserialize as an unhandled prompt behavior</a> with argument
18181838
<var>value</var>.
18191839

1840+
<dt><var>name</var> is the name of an <a>additional WebDriver
1841+
capability</a>
1842+
<dd><p>Let <var>deserialized</var> be the result of <a>trying</a>
1843+
to run the <a>additional capability deserialization
1844+
algorithm</a> for the extension capability corresponding
1845+
to <var>name</var>, with argument
1846+
<var>value</var>.
1847+
18201848
<dt><var>name</var> is the key of an <a>extension capability</a>
18211849
<dd><p>If <var>name</var> is known to the implementation,
18221850
let <var>deserialized</var> be the result of <a>trying</a>
@@ -1946,6 +1974,7 @@ <h3>Processing capabilities</h3>
19461974
<li><p>For each <var>name</var> and <var>value</var> corresponding
19471975
to <var>capability</var>’s <a>own properties</a>:
19481976
<ol>
1977+
<li><p>Let <var>match value</var> equal <var>value</var>.
19491978
<li><p>Run the substeps of the first matching <var>name</var>:
19501979

19511980
<dl class=switch>
@@ -2036,15 +2065,28 @@ <h3>Processing capabilities</h3>
20362065
will not be established.
20372066

20382067
<dt><strong>Otherwise</strong>
2039-
<dd><p>If <var>name</var> is the key of an
2040-
<a>extension capability</a>, <p>let <var>value</var> be the
2041-
result of <a>trying</a> implementation-specific steps to match
2042-
on <var>name</var> with <var>value</var>. If the match is not
2043-
successful, return <a>success</a> with data <a><code>null</code></a>.
2044-
</dl>
2068+
<dd>
2069+
<ul>
2070+
<li>
2071+
<p>If <var>name</var> is the name of an <a>additional
2072+
WebDriver capability</a> which defines a <a>matched
2073+
capability serialization algorithm</a>, let <var>match
2074+
value</var> be the result of running the <a>matched
2075+
capability serialization algorithm</a> for
2076+
capability <var>name</var> with
2077+
argument <var>value</var>.</li>
2078+
2079+
<li>
2080+
<p>Otherwise, if <var>name</var> is the key of an
2081+
<a>extension capability</a>, let <var>match value</var> be the
2082+
result of <a>trying</a> implementation-specific steps to
2083+
match on <var>name</var> with <var>value</var>. If the
2084+
match is not successful, return <a>success</a> with
2085+
data <a><code>null</code></a>.
2086+
</dl>
20452087

20462088
<li><p><a>Set a property</a> on <var>matched capabilities</var>
2047-
with name <var>name</var> and value <var>value</var>.
2089+
with name <var>name</var> and value <var>match value</var>.
20482090
</ol>
20492091

20502092
<li><p>Return <a>success</a> with data <var>matched capabilities</var>.

0 commit comments

Comments
 (0)