-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[py][bidi]: add bidi webExtension module #15749
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Nice. This looks really good.
-
The tests should
xfail
on the browsers besides Chrome/Edge I think (safari, ie, webkitgtk, wpewebkit) -
Should the tests also load a page and verify the extension is enabled like this?:
lambda dr: dr.find_element(By.ID, "webextensions-selenium-example")
@cgoldberg yes, we should verify after loading a page. I will update the tests. Also, found that using absolute path for the extensions is much better from the ff_addon test file. Regarding xfail markers for safari and other non-bidi browsers, I think we already skip them here: Lines 137 to 139 in a413faa
Adding separate markers will make the tests unnecessarily lengthy. WDYT? |
The tests are failing due to extension path not found on engflow runner, locally they work fine. If someone can directly run on engflow and troubleshoot the path, it would be great. I cannot access it directly. |
you're right.. I forgot about that.
It is failing on the GitHub runner also... I'm not sure why.. nothing looks incorrect in the failing test. other comments:
|
@cgoldberg thanks for the review. I will see if I can reduce the code duplication in the tests.
There's a slight difference in the way it uninstalls in that test, it uses the extension id directly instead of the dict response we get from installing the extension. if isinstance(extension_id_or_result, dict):
extension_id = extension_id_or_result.get("extension")
else:
extension_id = extension_id_or_result And for the test failures in the CI, I am still not sure why that's happening, any tips that will help in debugging? |
Not yet. I'll merge trunk so it runs again... maybe it will go away :) I'll take another look later today to help figure it out. |
@cgoldberg I added the required directories in the bazel BUILD file and now the CI that runs on github runner (CI / Python / Browser Tests (firefox, ubuntu)) passes but CI-RBE still fails :( |
@oliverdunk |
@cgoldberg all the tests are now passing. @shs96c helped in getting the files/dirs referenced correctly in bazel. Also, updated the tests to reduce duplication. |
Great question! I spoke to the team about this:
I'm keen to see if we can loosen any of these requirements where the risk is lower enough, but I don't expect we will do that in the immediate future. Side-note: It would be great to see #15660 land but I haven't been able to reach anyone on the Selenium team about it. Is there any chance you would be able to help with finding a reviewer? |
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.
@navin772 LGTM .. thanks
My only question is how do the tests in ff_installs_addons_tests.py
possibly work without the same runfiles
change? That's really weird. Should we make the same change in that file for consistency?
@cgoldberg
It happened with this test also in this PR. |
@oliverdunk I'll see if I can nudge someone to review it |
@navin772 is this ready to merge? 4.33 release is going out soon and it would be nice to include this. |
@cgoldberg yes, it's ready! |
@navin772 oops.. I just thought of one more thing. Add the module name to Then go ahead and merge it. |
User description
🔗 Related Issues
💥 What does this PR do?
Adds the BiDi webExtension module to the python bindings - https://w3c.github.io/webdriver-bidi/#module-webExtension
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement, Tests
Description
Add BiDi webExtension module to Python bindings
Implement install and uninstall methods for web extensions
Expose webextension property in Remote WebDriver
Add comprehensive tests for webExtension functionality
Changes walkthrough 📝
webextension.py
Add BiDi WebExtension module with install/uninstall methods
py/selenium/webdriver/common/bidi/webextension.py
webdriver.py
Integrate webExtension property into Remote WebDriver
py/selenium/webdriver/remote/webdriver.py
bidi_webextension_tests.py
Add tests for BiDi webExtension install/uninstall
py/test/selenium/webdriver/common/bidi_webextension_tests.py