-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[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-remote
target so it picks up tests inpy/test/selenium/webdriver/remote/
. Previously, it was skipping them.pytest_generate_tests
to mainconftest.py
, allowing all tests to access--driver
flag while removing duplicateconftest.py
filesdriver
fixture so it skips Remote WebDriver tests when called with a local driverfirefox_options
fixture that returns an instance ofFirefoxOptions
with headless enabled/disabled depending on whether--headless
arg was given. This is useful in tests that don't use the maindriver
fixture to launch the browserconftest.py
🔄 Types of changes
PR Type
Bug fix, Enhancement
Description
Centralize and fix driver parametrization for all tests
pytest_generate_tests
to mainconftest.py
conftest.py
files in subdirectoriesFix and re-enable remote WebDriver tests in Bazel
Add new
headless
fixture for consistent headless option accessRefactor and clean up remote and Firefox test implementations
Changes walkthrough 📝
4 files
Centralize driver parametrization, add headless fixture, improve
skipping logic
Use new headless fixture and context manager for driver
Use fixture for custom element driver, cleanup test logic
Refactor to use headless fixture and context manager, remove custom
fixtures
4 files
Remove duplicate driver parametrization logic
Remove duplicate driver parametrization logic
Remove duplicate driver parametrization logic
Remove duplicate driver parametrization logic
1 files
Add docstring, clarify test intent for browser-specific method
1 files
Mark tests as skipped, add pytest import
1 files
Minor import reordering
1 files
Add options to Remote, improve assertion for SSL error
1 files
Update Bazel config to include remote tests, remove obsolete
conftest.py references