-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[rb] Implement High Level Logging API with BiDi #14073
Conversation
PR Review 🔍(Review updated until commit aeb7b85)
Code feedback:
|
PR Code Suggestions ✨
|
CI Failure Feedback 🧐(Checks updated until commit 4252b00)
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
where Configuration options
See more information about the |
/help |
PR Agent Walkthrough 🤖Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more. Here is a list of tools you can use to interact with the PR Agent:
(1) Note that each tool be triggered automatically when a new PR is opened, or called manually by commenting on a PR. (2) Tools marked with [*] require additional parameters to be passed. For example, to invoke the |
Persistent review updated to latest commit aeb7b85 |
PR Description updated to latest commit (aeb7b85)
|
PR Code Suggestions ✨
|
I have some more tweaks for this, but does it look good enough for now? |
PR Code Suggestions ✨
|
* add and remove logging handlers with BiDi * use #object_id instead of creating new ids to track callbacks * do not send browsing contexts to subscription if not needed * deprecate Driver#script & LogInspector * error if trying to remove an id that does not exist * do not unsubscribe if never subscribed in the first place * do not deprecate callbacks people don't have to care about getting the id back
User description
Description
Motivation and Context
Partial Ruby implementation of #13992
#13964
Updates
Based on feedback:
#object_id
of the proc to return the id instead of tracking it separatelyScript
class is going to implement things from both script and log domains. It makes sense to implement the domain specific functionality in separate, lower level classes and keepScript
for the high level API, so I createdLogHandler
class for this.Driver#script
alias ofDriver#exectue_script
LogInspector
- this should provide all of the required functionality of LogInspectorPR Type
Enhancement, Tests, Documentation
Description
LogHandler
class for managing console and JavaScript log entries.BiDi#callbacks
andLogInspector
class.add_callback
andremove_callback
methods toWebSocketConnection
.Script
class to handle log entries and manage handlers.subscribe
andunsubscribe
methods inSession
class to use keyword arguments.Script
class and BiDi error handling.Driver
andScript
classes.Changes walkthrough 📝
9 files
bidi.rb
Enhance BiDi with logging handlers and callback management
rb/lib/selenium/webdriver/bidi.rb
LogHandler
andStruct
autoloads.BiDi#callbacks
method.add_callback
andremove_callback
methods.log_handler.rb
Introduce LogHandler class for managing log entries
rb/lib/selenium/webdriver/bidi/log_handler.rb
LogHandler
class for managing log entries.log_inspector.rb
Deprecate LogInspector and update callback handling
rb/lib/selenium/webdriver/bidi/log_inspector.rb
LogInspector
class.add_callback
instead of direct callbackmanipulation.
session.rb
Refactor session subscription methods with keyword arguments
rb/lib/selenium/webdriver/bidi/session.rb
subscribe
andunsubscribe
methods to use keyword arguments.struct.rb
Add Struct class for camel to snake case conversion
rb/lib/selenium/webdriver/bidi/struct.rb
Struct
class to convert camel case JSON keys to snake casemethods.
common.rb
Require Script class in common module
rb/lib/selenium/webdriver/common.rb
require 'selenium/webdriver/common/script'
.driver.rb
Deprecate Driver#script alias and add Script instance method
rb/lib/selenium/webdriver/common/driver.rb
Driver#script
alias for#execute_script
.Driver#script
method for accessingScript
instance.script.rb
Add Script class for handling log entries
rb/lib/selenium/webdriver/common/script.rb
Script
class to handle console and JavaScript log entries.websocket_connection.rb
Add callback management methods to WebSocketConnection
rb/lib/selenium/webdriver/common/websocket_connection.rb
add_callback
andremove_callback
methods for managing WebSocketcallbacks.
3 files
script_spec.rb
Add integration tests for Script class
rb/spec/integration/selenium/webdriver/bidi/script_spec.rb
Script
class.bidi_spec.rb
Add BiDi error handling and deprecation tests
rb/spec/integration/selenium/webdriver/bidi_spec.rb
BiDi#callbacks
.driver_spec.rb
Add test for Driver#script method with deprecation warning
rb/spec/integration/selenium/webdriver/driver_spec.rb
Driver#script
method with deprecation warning.2 files
driver.rbs
Update type signature for Driver class
rb/sig/lib/selenium/webdriver/common/driver.rbs
@script
instance variable to type signature.script.rbs
Add type signatures for Script class
rb/sig/selenium/web_driver/script.rbs
Script
class methods.