-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java][bidi]: add getData, addDataCollector and removeDataCollector commands
#16336
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 Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
| } | ||
|
|
||
| @Test | ||
| @NeedsFreshDriver |
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.
Why can't the test reuse the driver? Is this a BiDi limitation?
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.
I added it since other tests were using it too, I will check if its strictly required or not.
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.
@diemol 3 tests fail when @NeedsFreshDriver is removed from all the tests, 2 auth ones and 1 data collector that was added.
Should I remove it for other tests? It does reduce the test execution time by a lot (45sec -> 14sec)
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.
We need to be able to clear handlers to reuse drivers
|
So, data collection doesn't make sense outside the context of an interception. You have to pass a request id to get the data, which is only accessible from a handler. I think this should all be private API. When you register a handler you specify if you need the body, and that method registers the collector and manages it in the background. |
User description
🔗 Related Issues
💥 What does this PR do?
Adds
getData,addDataCollectorandremoveDataCollectorcommands as in BiDi spec:🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add BiDi network data collection commands per W3C spec
Implement
addDataCollector,removeDataCollector, andgetDatamethodsCreate parameter classes for data collection configuration
Add comprehensive test coverage for all new functionality
Diagram Walkthrough
File Walkthrough
Network.java
Add network data collection methodsjava/src/org/openqa/selenium/bidi/module/Network.java
addDataCollector,removeDataCollector,getDatagetDatacommand responseAddDataCollectorParameters.java
Create AddDataCollectorParameters classjava/src/org/openqa/selenium/bidi/network/AddDataCollectorParameters.java
addDataCollectorcommandDataType.java
Add DataType enumjava/src/org/openqa/selenium/bidi/network/DataType.java
GetDataParameters.java
Create GetDataParameters classjava/src/org/openqa/selenium/bidi/network/GetDataParameters.java
getDatacommandNetworkCommandsTest.java
Add data collection command testsjava/test/org/openqa/selenium/bidi/network/NetworkCommandsTest.java