-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py][bidi]: improve tests to use local no-proxy server #16747
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
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||||||
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.
This looks great.
What do you think about moving the proxy server stuff into fixtures (something like proxy_server and no_proxy_server)? It would be a little nicer as fixtures instead of functions where you have to remember to stop the server.
It also might be a good idea to keep them in ./py/conftest.py. That way we could expand the other proxy tests (./py/test/selenium/webdriver/chrome/proxy_tests.py) to use them when we convert the high level API to use BiDi.
Yes, that's a good idea, we can have 1 fixture - |
User description
🔗 Related Issues
💥 What does this PR do?
Starts and uses a local http server for the no-proxy tests since occasionally
the internetsite is down and results in tests failing.🔧 Implementation Notes
Also enables 2 proxy tests for firefox.
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement, Tests
Description
Refactor proxy test infrastructure to use local HTTP servers
Replace external site dependency with local no-proxy server
Remove Firefox and remote xfail markers from proxy tests
Generalize HTTP server handler for reusable test utilities
Diagram Walkthrough
File Walkthrough
bidi_browser_tests.py
Refactor proxy tests to use local HTTP serverspy/test/selenium/webdriver/common/bidi_browser_tests.py
FakeProxyHandlerinto genericstart_local_http_server()function with configurable response content and logging
start_fake_proxy()to use the new generic server functionthe-internet.herokuapp.comdependency with localHTTP server for no-proxy testing
@pytest.mark.xfail_firefoxand@pytest.mark.xfail_remotedecorators from proxy tests
shutdown()andserver_close()callsin test teardown
external URLs