Skip to content
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

WebDriver BiDi support in testdriver needs documentation #47565

Open
rakuco opened this issue Aug 12, 2024 · 6 comments
Open

WebDriver BiDi support in testdriver needs documentation #47565

rakuco opened this issue Aug 12, 2024 · 6 comments
Assignees

Comments

@rakuco
Copy link
Member

rakuco commented Aug 12, 2024

Now that #45823 has been merged, it would be good to update the existing testdriver documentation. Having support for https://w3c.github.io/permissions/#webdriver-bidi-command-permissions-setPermission in testdriver would be great, but it is unclear how this is supposed to happen.

Specifically, at least https://web-platform-tests.org/writing-tests/testdriver.html and https://web-platform-tests.org/writing-tests/testdriver-extension-tutorial.html should be updated.

@rakuco
Copy link
Member Author

rakuco commented Aug 12, 2024

cc @OrKoN @foolip

@OrKoN
Copy link
Contributor

OrKoN commented Aug 12, 2024

@rakuco extending testdriver.js with a WebDriver BiDi command does not require an RFC so you should be able to add the testdriver.js wrapper if you need to use the command.

@sadym-chromium
Copy link
Contributor

sadym-chromium commented Aug 12, 2024

@rakuco even though we will happily extend the documentation, I wonder what extension of the existing https://web-platform-tests.org/writing-tests/testdriver.html#permissions do you need?

@rakuco
Copy link
Member Author

rakuco commented Aug 12, 2024

I wonder what extension of the existing https://web-platform-tests.org/writing-tests/testdriver.html#permissions do you need?

The support for specifying an origin, which only exists in the BiDi endpoint. Without this, it's not possible to set permissions in cross-origin iframes.

@OrKoN
Copy link
Contributor

OrKoN commented Aug 12, 2024

I think set_permission is a bit special since it exists in both specs. I would suggest to change the implementation in tools/wptrunner/wptrunner/testdriver-extra.js to use the webdriver-bidi endpoint. I guess the third argument can be changed to be a context (window) or an origin (string), and if the context is a window, we take the window.location.origin as the default origin.

@sadym-chromium
Copy link
Contributor

sadym-chromium commented Nov 14, 2024

I think set_permission is a bit special since it exists in both specs. I would suggest to change the implementation in tools/wptrunner/wptrunner/testdriver-extra.js to use the webdriver-bidi endpoint. I guess the third argument can be changed to be a context (window) or an origin (string), and if the context is a window, we take the window.location.origin as the default origin.

I assume this comment was done before we figured out, that the switch to WebDriver BiDi transport will be a gradual. I guess we should map the bidi methods to test_driver.bidi... to avoid confusion by different APIs, and to allow for enabling BiDi on-demand.

I created PRs adding test_driver.bidi.permissions.set_permission #49170 and documenting the process #49168. I guess they are addressing the issues you are facing.

Please note that test_driver.bidi is not available yet and is blocked by web-platform-tests/rfcs#214 and its implementation #49122.

sadym-chromium added a commit that referenced this issue Nov 14, 2024
Extend [Testdriver extension tutorial](https://web-platform-tests.org/writing-tests/testdriver-extension-tutorial.html) with description of adding new methods matching WebDriver BiDi commands.

Addressing #47565.

Apparently, the current version is outdated, as it refers to the non-existing `SetWindowRectProtocolPart`. I updated the protocol part name to avoid confusion with the action name, but leave `SetWindowRectProtocolPart` out of scope for this PR.

BiDi events are out of scope as well.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 16, 2024
… bidi, a=testonly

Automatic update from web-platform-tests
[doc] describe extending testdriver with bidi (#49168)

Extend [Testdriver extension tutorial](https://web-platform-tests.org/writing-tests/testdriver-extension-tutorial.html) with description of adding new methods matching WebDriver BiDi commands.

Addressing web-platform-tests/wpt#47565.

Apparently, the current version is outdated, as it refers to the non-existing `SetWindowRectProtocolPart`. I updated the protocol part name to avoid confusion with the action name, but leave `SetWindowRectProtocolPart` out of scope for this PR.

BiDi events are out of scope as well.
--

wpt-commits: 2ab6df48425b314c6e28f0833c8ca4ef9e0f846d
wpt-pr: 49168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants