-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Re-enable remote tests in bazel and fix broken tests #15657
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 🔍(Review updated until commit 5d6d8c9)Here are some key observations to aid the review process:
|
|
Does it need a separate conftest? It'll be easy to overlook it if there are multiple. |
Good call... it doesn't. I just moved the function it contained into the main conftest, which allowed me to removed it, along with 3 other duplicate conftests. I just updated the PR description too. This ended up larger than I was expecting, but it cleans up a lot of junk. I haven't tested it all yet, so we'll see if CI passes :) |
|
Can you take a look at There are 2 tests that you added in #14587. They fail for me locally, so I have them marked to skip (they weren't getting run in CI before this PR). I don't really understand what they do and don't know if they are failing because of a real issue or they are just broken tests. |
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
|
Hi @cgoldberg, the tests are failing because of a misconfiguration, the remote webdriver expects the driver = webdriver.Remote(command_executor="http://localhost:4444", options=options, locator_converter=CustomLocatorConverter())Do you know how can I add the above only for my test file? |
|
@navin772 I'll fix it in this branch. Thanks! |
|
@navin772 thanks.. that worked.
I added a small fixture to the test file so it doesn't use the main |
|
@cgoldberg thanks for the changes, this PR looks good, just run the formatter once. |
Right, I had no idea there were multiple of these, so thanks! |
|
The only failure in CI is not related to this PR. |
User description
🔗 Related Issues
💥 What does this PR do?
This PR fixes several issue with Python Remote WebDriver tests:
//py:test-remotetarget so it picks up tests inpy/test/selenium/webdriver/remote/. Previously, it was skipping them.pytest_generate_teststo mainconftest.py, allowing all tests to access--driverflag while removing duplicateconftest.pyfilesdriverfixture so it skips Remote WebDriver tests when called with a local driverfirefox_optionsfixture that returns an instance ofFirefoxOptionswith headless enabled/disabled depending on whether--headlessarg was given. This is useful in tests that don't use the maindriverfixture to launch the browserconftest.py🔄 Types of changes
PR Type
Bug fix, Enhancement
Description
Centralize and fix driver parametrization for all tests
pytest_generate_teststo mainconftest.pyconftest.pyfiles in subdirectoriesFix and re-enable remote WebDriver tests in Bazel
Add new
headlessfixture for consistent headless option accessRefactor and clean up remote and Firefox test implementations
Changes walkthrough 📝
4 files
Centralize driver parametrization, add headless fixture, improveskipping logicUse new headless fixture and context manager for driverUse fixture for custom element driver, cleanup test logicRefactor to use headless fixture and context manager, remove customfixtures4 files
Remove duplicate driver parametrization logicRemove duplicate driver parametrization logicRemove duplicate driver parametrization logicRemove duplicate driver parametrization logic1 files
Add docstring, clarify test intent for browser-specific method1 files
Mark tests as skipped, add pytest import1 files
Minor import reordering1 files
Add options to Remote, improve assertion for SSL error1 files
Update Bazel config to include remote tests, remove obsoleteconftest.py references