-
Notifications
You must be signed in to change notification settings - Fork 28
User Agent Automation and WebDriver test support #381
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
base: main
Are you sure you want to change the base?
Changes from all commits
6175ccf
783df7d
4c1c17c
deaa4c6
8300b5c
9b60592
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2141,6 +2141,265 @@ <h2> | |||||||||||||
| This section is a work in progress as this document evolves. | ||||||||||||||
| </p> | ||||||||||||||
| </section> | ||||||||||||||
| <section id="user-agent-automation" data-cite="webdriver"> | ||||||||||||||
| <h2> | ||||||||||||||
| User Agent Automation | ||||||||||||||
| </h2> | ||||||||||||||
| <p> | ||||||||||||||
| For the purposes of user agent automation and web application testing, | ||||||||||||||
| this document defines a number of [[WebDriver]] [=extension commands=]. | ||||||||||||||
| </p> | ||||||||||||||
| <section id="webdriver-extension-capability"> | ||||||||||||||
| <h3> | ||||||||||||||
| Digital Credentials WebDriver Extension Capability | ||||||||||||||
| </h3> | ||||||||||||||
| <p> | ||||||||||||||
| In order to advertise the availability of [=extension commands=] | ||||||||||||||
| defined below, a new extension capability is defined. | ||||||||||||||
| </p> | ||||||||||||||
| <table class="data"> | ||||||||||||||
| <thead> | ||||||||||||||
| <tr> | ||||||||||||||
| <th> | ||||||||||||||
| Capability | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| Key | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| Value Type | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| Description | ||||||||||||||
| </th> | ||||||||||||||
| </tr> | ||||||||||||||
| </thead> | ||||||||||||||
| <tbody> | ||||||||||||||
| <tr> | ||||||||||||||
| <td> | ||||||||||||||
| Virtual Wallet Support | ||||||||||||||
|
Collaborator
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.
Suggested change
Collaborator
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 haven't really used "wallet" formally... we've stuck to holder... so I wonder if this should be "virtual holder"
Contributor
Author
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. @timcappalli I am aware of your preferences to use "Credential Manager" instead of holder or wallet, but I think we should do this holistically in the whole spec at one time if we decide to. I won't start with the testing. @marcoscaceres Yes, I can see we haven't used wallet formally, but given this API is exposed to web developers as well as browser engineers, I believe "wallet" is the more widely-used term in the ecosystem.
Collaborator
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. Discussed with @mohamedamir and drafted: And hopefully that covers the "manager" aspect that @timcappalli would like included in the definition, while giving us a well understood concept by developer and implementers.
Contributor
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 think "virtual (whatever)" is not accurate and will be misunderstood. Better might be "software (whatever)" (even if it's implemented on hardware, it's still software doing the lifting). Rather than |
||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| `digital-credentials:virtualWallet` | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| [=boolean=] | ||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| Indicates whether the endpoint node supports all Virtual Wallet | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| commands. | ||||||||||||||
| </td> | ||||||||||||||
| </tr> | ||||||||||||||
| </tbody> | ||||||||||||||
| </table> | ||||||||||||||
| <p> | ||||||||||||||
| When <a data-cite="webdriver#dfn-validate-capabilities">validating | ||||||||||||||
|
Collaborator
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. nit: avoid using data-cite... if something hasn't been exported from Web Driver, we should send a PR to web driver to export the definition we need. |
||||||||||||||
| capabilities</a>, the extension-specific substeps to validate | ||||||||||||||
| `digital-credentials:virtualWallet` with `value` are the following: | ||||||||||||||
| </p> | ||||||||||||||
| <ol class="algorithm"> | ||||||||||||||
| <li>If `value` is not a [=boolean=], return a [=error|WebDriver | ||||||||||||||
| error=] with a [=error code|WebDriver error code=] [=invalid | ||||||||||||||
| argument=]. | ||||||||||||||
| </li> | ||||||||||||||
| <li>Otherwise, let `deserialized` be set to `value`. | ||||||||||||||
| </li> | ||||||||||||||
| </ol> | ||||||||||||||
| <p> | ||||||||||||||
| When <a data-cite="webdriver#dfn-matching-capabilities">matching | ||||||||||||||
| capabilities</a>, the extension-specific steps to match | ||||||||||||||
| `digital-credentials:virtualWallet` with `value` are the following: | ||||||||||||||
| </p> | ||||||||||||||
| <ol class="algorithm"> | ||||||||||||||
| <li>If `value is <code>true` 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.</code> | ||||||||||||||
| </li> | ||||||||||||||
| <li> | ||||||||||||||
| <code>Otherwise, the match is successful.</code> | ||||||||||||||
| </li> | ||||||||||||||
| </ol> | ||||||||||||||
| </section> | ||||||||||||||
| <section id="virtual-wallet-commands"> | ||||||||||||||
|
Collaborator
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.
Suggested change
Collaborator
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. Best to avoid acronyms 🙏
Contributor
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 don't know how much acronym avoidance matters in fragment identifiers, but it still might be better to abbreviate somewhat less, perhaps as —
Suggested change
Collaborator
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 can leave ReSpec to generate the ids. It knows best.
Collaborator
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. Pro-tip: you can also omit the section tag (ReSpec adds it automatically) |
||||||||||||||
| <h3> | ||||||||||||||
| <code>Virtual Wallet Commands</code> | ||||||||||||||
| </h3> | ||||||||||||||
| <p> | ||||||||||||||
| <code>The following commands allow controlling the behavior of a | ||||||||||||||
| virtual wallet for testing purposes. These commands affect the | ||||||||||||||
| <dfn>next wallet behavior</dfn> of the next | ||||||||||||||
| `navigator.credentials.get({digital: ...})` or | ||||||||||||||
| `navigator.credentials.create({digital: ...})` call.</code> | ||||||||||||||
| </p> | ||||||||||||||
| <section id="set-wallet-response"> | ||||||||||||||
| <h4> | ||||||||||||||
| <code><dfn>Set Wallet Response</dfn></code> | ||||||||||||||
| </h4> | ||||||||||||||
| <p> | ||||||||||||||
| <code>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.</code> | ||||||||||||||
| </p> | ||||||||||||||
| <table class="data"> | ||||||||||||||
| <thead> | ||||||||||||||
| <tr> | ||||||||||||||
| <th> | ||||||||||||||
| HTTP Method | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| URI Template | ||||||||||||||
| </th> | ||||||||||||||
| </tr> | ||||||||||||||
| </thead> | ||||||||||||||
| <tbody> | ||||||||||||||
| <tr> | ||||||||||||||
| <td> | ||||||||||||||
| `POST` | ||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| <code>/session/{session | ||||||||||||||
| id}/digital-credentials/response</code> | ||||||||||||||
| </td> | ||||||||||||||
| </tr> | ||||||||||||||
| </tbody> | ||||||||||||||
| </table> | ||||||||||||||
| <p> | ||||||||||||||
| The parameters object is a JSON <a data-cite= | ||||||||||||||
| "webdriver#dfn-object">Object</a> with the following key: | ||||||||||||||
|
Collaborator
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. as above... we should get "object" exported from Web Driver. |
||||||||||||||
| </p> | ||||||||||||||
| <table class="data"> | ||||||||||||||
| <thead> | ||||||||||||||
| <tr> | ||||||||||||||
| <th> | ||||||||||||||
| Key | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| Value Type | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| Description | ||||||||||||||
| </th> | ||||||||||||||
| </tr> | ||||||||||||||
| </thead> | ||||||||||||||
| <tbody> | ||||||||||||||
| <tr> | ||||||||||||||
| <td> | ||||||||||||||
| `data` | ||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| string | ||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| The data to be returned by the wallet. | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| </td> | ||||||||||||||
| </tr> | ||||||||||||||
| </tbody> | ||||||||||||||
| </table> | ||||||||||||||
| <p> | ||||||||||||||
| The [=remote end steps=] are: | ||||||||||||||
| </p> | ||||||||||||||
| <ol class="algorithm"> | ||||||||||||||
| <li>If `parameters` is not a JSON <a data-cite= | ||||||||||||||
| "webdriver#dfn-object">Object</a>, or if it does not contain a | ||||||||||||||
| `data` property of type string, return a [=error|WebDriver error=] | ||||||||||||||
| with [=error code|WebDriver error code=] [=invalid argument=]. | ||||||||||||||
| </li> | ||||||||||||||
| <li>Set the session's [=next wallet behavior=] to <code>{ "mode": | ||||||||||||||
| "respond", "data": parameters.data }</code>. | ||||||||||||||
| </li> | ||||||||||||||
| <li>Return [=success=]. | ||||||||||||||
| </li> | ||||||||||||||
| </ol> | ||||||||||||||
| </section> | ||||||||||||||
| <section id="set-wallet-to-wait"> | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| <h4> | ||||||||||||||
| <dfn>Set Wallet to Wait</dfn> | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| </h4> | ||||||||||||||
| <p> | ||||||||||||||
| The [=Set Wallet to Wait=] [[WebDriver]] [=extension command=] | ||||||||||||||
| configures the virtual wallet to simulate a user waiting | ||||||||||||||
| indefinitely in the wallet UI. | ||||||||||||||
|
Comment on lines
+2320
to
+2322
Collaborator
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.
Suggested change
|
||||||||||||||
| </p> | ||||||||||||||
| <table class="data"> | ||||||||||||||
| <thead> | ||||||||||||||
| <tr> | ||||||||||||||
| <th> | ||||||||||||||
| HTTP Method | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| URI Template | ||||||||||||||
| </th> | ||||||||||||||
| </tr> | ||||||||||||||
| </thead> | ||||||||||||||
| <tbody> | ||||||||||||||
| <tr> | ||||||||||||||
| <td> | ||||||||||||||
| `POST` | ||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| <code>/session/{session | ||||||||||||||
| id}/digital-credentials/response_wait</code> | ||||||||||||||
| </td> | ||||||||||||||
| </tr> | ||||||||||||||
| </tbody> | ||||||||||||||
| </table> | ||||||||||||||
| <p> | ||||||||||||||
| The [=remote end steps=] are: | ||||||||||||||
| </p> | ||||||||||||||
| <ol class="algorithm"> | ||||||||||||||
| <li>Set the session's [=next wallet behavior=] to <code>{ "mode": | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| "wait" }</code>. | ||||||||||||||
| </li> | ||||||||||||||
| <li>Return [=success=]. | ||||||||||||||
| </li> | ||||||||||||||
| </ol> | ||||||||||||||
| </section> | ||||||||||||||
| <section id="set-wallet-to-decline"> | ||||||||||||||
| <h4> | ||||||||||||||
| <dfn>Set Wallet to Decline</dfn> | ||||||||||||||
|
Collaborator
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. Maybe we should say "abort" here to keep terminology consistent? (i.e., affectively this become an AbortError, right)?
Contributor
Author
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. YEs, but it's to simulate a user "declining" the flow.
Collaborator
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. No, "declining" is fine... was mostly an editorial suggestion.
Comment on lines
+2358
to
+2360
Collaborator
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.
Suggested change
|
||||||||||||||
| </h4> | ||||||||||||||
| <p> | ||||||||||||||
| The [=Set Wallet to Decline=] [[WebDriver]] [=extension command=] | ||||||||||||||
| configures the virtual wallet to simulate a user declining the | ||||||||||||||
| request. | ||||||||||||||
|
Comment on lines
+2363
to
+2365
Collaborator
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.
Suggested change
|
||||||||||||||
| </p> | ||||||||||||||
| <table class="data"> | ||||||||||||||
| <thead> | ||||||||||||||
| <tr> | ||||||||||||||
| <th> | ||||||||||||||
| HTTP Method | ||||||||||||||
| </th> | ||||||||||||||
| <th> | ||||||||||||||
| URI Template | ||||||||||||||
| </th> | ||||||||||||||
| </tr> | ||||||||||||||
| </thead> | ||||||||||||||
| <tbody> | ||||||||||||||
| <tr> | ||||||||||||||
| <td> | ||||||||||||||
| `POST` | ||||||||||||||
| </td> | ||||||||||||||
| <td> | ||||||||||||||
| <code>/session/{session | ||||||||||||||
| id}/digital-credentials/response_decline</code> | ||||||||||||||
| </td> | ||||||||||||||
| </tr> | ||||||||||||||
| </tbody> | ||||||||||||||
| </table> | ||||||||||||||
| <p> | ||||||||||||||
| The [=remote end steps=] are: | ||||||||||||||
| </p> | ||||||||||||||
| <ol class="algorithm"> | ||||||||||||||
| <li>Set the session's [=next wallet behavior=] to <code>{ "mode": | ||||||||||||||
|
Collaborator
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.
Suggested change
|
||||||||||||||
| "decline" }</code>. | ||||||||||||||
| </li> | ||||||||||||||
| <li>Return [=success=]. | ||||||||||||||
| </li> | ||||||||||||||
| </ol> | ||||||||||||||
| </section> | ||||||||||||||
| </section> | ||||||||||||||
| </section> | ||||||||||||||
| <section id="idl-index"></section> | ||||||||||||||
| <section id="conformance"></section> | ||||||||||||||
| <h2 class="appendix"> | ||||||||||||||
|
|
||||||||||||||
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.
Nit: let ReSpec handle the id generation.