Skip to content

Commit 6175ccf

Browse files
committed
user agent automation section and update the algorithms
1 parent c9ff5e0 commit 6175ccf

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

index.html

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,18 @@ <h3>
856856
</li>
857857
</ol>
858858
</li>
859+
<li>If the session's "next wallet behavior" is set:
860+
</li>
861+
<ol>
862+
<li>If the mode is "respond", resolve the promise with a new `DigitalCredential` object whose `data` member is set to the stored `data`.
863+
</il>
864+
<li>If the mode is "wait", the promise never resolves.
865+
</il>
866+
<li>If the mode is "decline", reject the promise with a "NotAllowedError" `DOMException`.
867+
</il>
868+
</ol>
869+
<li>Otherwise (if "next wallet behavior" is not set), proceed with the normal user-interactive flow to select and use a digital credential.
870+
</li>
859871
<li>
860872
<aside class="issue">
861873
Details of how to actually get the [=digital credential=] are
@@ -917,6 +929,18 @@ <h3>
917929
</li>
918930
</ol>
919931
</li>
932+
<li>If the session's "next wallet behavior" is set:
933+
</li>
934+
<ol>
935+
<li>If the mode is "respond", resolve the promise with a new `DigitalCredential` object whose `data` member is set to the stored `data`.
936+
</il>
937+
<li>If the mode is "wait", the promise never resolves.
938+
</il>
939+
<li>If the mode is "decline", reject the promise with a "NotAllowedError" `DOMException`.
940+
</il>
941+
</ol>
942+
<li>Otherwise (if "next wallet behavior" is not set), proceed with the normal user-interactive flow to select and use a digital credential.
943+
</li>
920944
<li>
921945
<aside class="issue">
922946
Details of how to actually issue the [=digital credential=] are
@@ -2141,6 +2165,150 @@ <h2>
21412165
This section is a work in progress as this document evolves.
21422166
</p>
21432167
</section>
2168+
<section id="user-agent-automation" data-cite="webdriver">
2169+
<h2>User Agent Automation</h2>
2170+
<p>
2171+
For the purposes of user agent automation and web application testing, this document defines a number of [[WebDriver]] [=extension commands=].
2172+
</p>
2173+
<section id="webdriver-extension-capability">
2174+
<h3>Digital Credentials WebDriver Extension Capability</h3>
2175+
<p>
2176+
In order to advertise the availability of [=extension commands=] defined below, a new extension capability is defined.
2177+
</p>
2178+
<table class="data">
2179+
<thead>
2180+
<tr>
2181+
<th>Capability</th>
2182+
<th>Key</th>
2183+
<th>Value Type</th>
2184+
<th>Description</th>
2185+
</tr>
2186+
</thead>
2187+
<tbody>
2188+
<tr>
2189+
<td>Virtual Wallet Support</td>
2190+
<td><code>digital-credentials:virtualWallet</code></td>
2191+
<td>[=boolean=]</td>
2192+
<td>Indicates whether the endpoint node supports all Virtual Wallet commands.</td>
2193+
</tr>
2194+
</tbody>
2195+
</table>
2196+
<p>
2197+
When <a data-cite="webdriver#dfn-validate-capabilities">validating capabilities</a>, the extension-specific substeps to validate <code>digital-credentials:virtualWallet</code> with <code>value</code> are the following:
2198+
</p>
2199+
<ol class="algorithm">
2200+
<li>If <code>value</code> is not a [=boolean=], return a [=error|WebDriver error=] with a [=error code|WebDriver error code=] [=invalid argument=]</a>.</li>
2201+
<li>Otherwise, let <code>deserialized</code> be set to <code>value</code>.</li>
2202+
</ol>
2203+
<p>
2204+
When <a data-cite="webdriver#dfn-matching-capabilities">matching capabilities</a>, the extension-specific steps to match <code>digital-credentials:virtualWallet</code> with <code>value</code> are the following:
2205+
</p>
2206+
<ol class="algorithm">
2207+
<li>If <code>value</code> is <code>true</code> and the <a data-cite="webdriver#dfn-endpoint-node">endpoint node</a> does not support any of the Virtual Wallet commands, the match is unsuccessful.</li>
2208+
<li>Otherwise, the match is successful.</li>
2209+
</ol>
2210+
</section>
2211+
<section id="virtual-wallet-commands">
2212+
<h3>Virtual Wallet Commands</h3>
2213+
<p>
2214+
The following commands allow controlling the behavior of a virtual wallet for testing purposes. These commands affect the behavior of the next <code>navigator.credentials.get({digital: ...})</code> or <code>navigator.credentials.create({digital: ...})</code> call.
2215+
</p>
2216+
<section id="set-wallet-response">
2217+
<h4><dfn>Set Wallet Response</dfn></h4>
2218+
<p>
2219+
The [=Set Wallet Response=] [[WebDriver]] [=extension command=] configures the virtual wallet to respond with a specific data payload, simulating a user successfully completing the flow.
2220+
</p>
2221+
<table class="data">
2222+
<thead>
2223+
<tr>
2224+
<th>HTTP Method</th>
2225+
<th>URI Template</th>
2226+
</tr>
2227+
</thead>
2228+
<tbody>
2229+
<tr>
2230+
<td><code>POST</code></td>
2231+
<td><code>/session/{session id}/digital-credentials/response</code></td>
2232+
</tr>
2233+
</tbody>
2234+
</table>
2235+
<p>The parameters object is a JSON <a data-cite="webdriver#dfn-object">Object</a> with the following key:</p>
2236+
<table class="data">
2237+
<thead>
2238+
<tr>
2239+
<th>Key</th>
2240+
<th>Value Type</th>
2241+
<th>Description</th>
2242+
</tr>
2243+
</thead>
2244+
<tbody>
2245+
<tr>
2246+
<td><code>data</code></td>
2247+
<td>string</td>
2248+
<td>The data to be returned by the wallet.</td>
2249+
</tr>
2250+
</tbody>
2251+
</table>
2252+
<p>The [=remote end steps=] are:</p>
2253+
<ol class="algorithm">
2254+
<li>If <code>parameters</code> is not a JSON <a data-cite="webdriver#dfn-object">Object</a>, or if it does not contain a <code>data</code> property of type string, return a [=error|WebDriver error=] with [=error code|WebDriver error code=] [=invalid argument=].</li>
2255+
<li>Set the session's "next wallet behavior" to <code>{ "mode": "respond", "data": parameters.data }</code>.</li>
2256+
<li>Return [=success=].</li>
2257+
</ol>
2258+
</section>
2259+
<section id="set-wallet-to-wait">
2260+
<h4><dfn>Set Wallet to Wait</dfn></h4>
2261+
<p>
2262+
The [=Set Wallet to Wait=] [[WebDriver]] [=extension command=] configures the virtual wallet to simulate a user waiting indefinitely in the wallet UI.
2263+
</p>
2264+
<table class="data">
2265+
<thead>
2266+
<tr>
2267+
<th>HTTP Method</th>
2268+
<th>URI Template</th>
2269+
</tr>
2270+
</thead>
2271+
<tbody>
2272+
<tr>
2273+
<td><code>POST</code></td>
2274+
<td><code>/session/{session id}/digital-credentials/response_wait</code></td>
2275+
</tr>
2276+
</tbody>
2277+
</table>
2278+
<p>The [=remote end steps=] are:</p>
2279+
<ol class="algorithm">
2280+
<li>Set the session's "next wallet behavior" to <code>{ "mode": "wait" }</code>.</li>
2281+
<li>Return [=success=].</li>
2282+
</ol>
2283+
</section>
2284+
<section id="set-wallet-to-decline">
2285+
<h4><dfn>Set Wallet to Decline</dfn></h4>
2286+
<p>
2287+
The [=Set Wallet to Decline=] [[WebDriver]] [=extension command=] configures the virtual wallet to simulate a user declining the request.
2288+
</p>
2289+
<table class="data">
2290+
<thead>
2291+
<tr>
2292+
<th>HTTP Method</th>
2293+
<th>URI Template</th>
2294+
</tr>
2295+
</thead>
2296+
<tbody>
2297+
<tr>
2298+
<td><code>POST</code></td>
2299+
<td><code>/session/{session id}/digital-credentials/response_decline</code></td>
2300+
</tr>
2301+
</tbody>
2302+
</table>
2303+
<p>The [=remote end steps=] are:</p>
2304+
<ol class="algorithm">
2305+
<li>Set the session's "next wallet behavior" to <code>{ "mode": "decline" }</code>.</li>
2306+
<li>Return [=success=].</li>
2307+
</ol>
2308+
</section>
2309+
</section>
2310+
</section>
2311+
21442312
<section id="idl-index"></section>
21452313
<section id="conformance"></section>
21462314
<h2 class="appendix">

0 commit comments

Comments
 (0)