Digital Credentials: Add WebDriver automation commands and tests#58587
Digital Credentials: Add WebDriver automation commands and tests#58587mohamedamir wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds WebDriver automation hooks for the Digital Credentials API so WPT tests can drive navigator.credentials.get() / create() using a simulated “virtual wallet” response mode.
Changes:
- Added new
test_driver/wptrunner actions to set virtual wallet behavior (respond / wait / decline). - Added a WebDriver protocol part wiring these actions to session extension commands under
digital-credentials/*. - Introduced new end-to-end WebDriver tests for
navigator.credentials.get()andnavigator.credentials.create().
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/wptrunner/wptrunner/testdriver-extra.js | Exposes new test_driver_internal.* hooks that enqueue wptrunner actions for virtual wallet control. |
| tools/wptrunner/wptrunner/executors/protocol.py | Defines DigitalCredentialsProtocolPart interface for wallet automation. |
| tools/wptrunner/wptrunner/executors/executorwebdriver.py | Implements the WebDriver-backed protocol part and registers it in the WebDriver protocol. |
| tools/wptrunner/wptrunner/executors/actions.py | Adds action handlers mapping testdriver messages to protocol.digital_credentials.* calls. |
| resources/testdriver.js | Exposes new test_driver.* API surface and vendor-stub methods for the new commands. |
| digital-credentials/webdriver/get.https.html | New WebDriver E2E tests for navigator.credentials.get() covering respond/decline/wait+abort flows. |
| digital-credentials/webdriver/create.https.html | New WebDriver E2E tests for navigator.credentials.create() covering respond/decline/wait+abort flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
52ff1d1 to
6dba083
Compare
24484fe to
dc075e0
Compare
dc075e0 to
0d6819b
Compare
…r automated testing https://bugs.webkit.org/show_bug.cgi?id=306292 Reviewed by NOBODY (OOPS!). Add a WebDriver BiDi `digitalCredentials` module that enables automated testing of digital credential flows without requiring a real wallet. The module provides a `setVirtualWalletBehavior` command that configures how the user agent responds to credential requests during automation: - "respond": returns a synthetic credential with the given protocol and response data - "decline": rejects the request with a NotAllowedError - "wait": leaves the credential promise unsettled - "clear": removes the configured behavior Behavior can be scoped to a specific browsing context or set as the session default. The interception occurs in WebPageProxy before the platform credential picker is shown. Spec: https://w3c-fedid.github.io/digital-credentials/#automated-testing WPT: web-platform-tests/wpt#58587 * Source/WebKit/CMakeLists.txt: * Source/WebKit/Sources.txt: * Source/WebKit/UIProcess/Automation/BidiDigitalCredentialsAgent.cpp: Added. * Source/WebKit/UIProcess/Automation/BidiDigitalCredentialsAgent.h: Added. * Source/WebKit/UIProcess/Automation/WebDriverBidiProcessor.cpp: * Source/WebKit/UIProcess/Automation/WebDriverBidiProcessor.h: * Source/WebKit/UIProcess/Automation/protocol/BidiDigitalCredentials.json: Added. * Source/WebKit/UIProcess/WebPageProxy.cpp:
marcoscaceres
left a comment
There was a problem hiding this comment.
CI infra failures are caused by a self.logger assignment in the new WebDriverDigitalCredentialsPart.setup() — ProtocolPart.logger is a read-only @property. Two inline suggestions below.
Co-authored-by: Marcos Cáceres <marcos@marcosc.com>
|
Looks great... will send any bugs (and fixes!) I find! |
|
The macOS infra failure isn't this PR. The single unexpected result is The test has metadata saying Filing a separate infra issue. Safe to ignore on your side. |
This PR adds WebDriver BiDi automation support for the Digital Credentials API in Web Platform Tests (WPT), implementing the spec changes proposed in w3c-fedid/digital-credentials#381.
Summary of Changes
Infrastructure Support
digitalCredentials.setVirtualWalletBehaviorcommand as defined in the Digital Credentials specification.protocol.py,actions.py, andexecutorwebdriver.pyto handle the BiDi command via the browser's BiDi session.test_driver.set_virtual_wallet_behaviorto tests, allowing them to configure the simulated wallet's response to API calls.Tests
navigator.credentials.get()andnavigator.credentials.create()in thedigital-credentials/webdriver/directory.NotAllowedErrorwhen the mock wallet simulates a user decline.