-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[java][BiDi] implement emulation #16070
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:
|
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.
Pull Request Overview
This PR implements the BiDi emulation module for Java, specifically focusing on geolocation override functionality. The implementation follows the W3C WebDriver BiDi emulation specification and provides a comprehensive API for controlling geolocation behavior in browser contexts.
- Adds core emulation classes including
Emulation
,GeolocationCoordinates
, and parameter classes - Implements geolocation override functionality with proper validation and error handling
- Creates extensive test coverage for both browsing contexts and user contexts
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
java/src/org/openqa/selenium/bidi/emulation/Emulation.java |
Main emulation module class providing BiDi command execution |
java/src/org/openqa/selenium/bidi/emulation/GeolocationCoordinates.java |
Geolocation data class with coordinate validation |
java/src/org/openqa/selenium/bidi/emulation/SetGeolocationOverrideParameters.java |
Parameter class for geolocation override commands |
java/src/org/openqa/selenium/bidi/emulation/GeolocationPositionError.java |
Error representation for geolocation failures |
java/test/org/openqa/selenium/bidi/emulation/EmulationTest.java |
Comprehensive test suite covering various emulation scenarios |
java/src/org/openqa/selenium/bidi/emulation/BUILD.bazel |
Build configuration for emulation package |
java/test/org/openqa/selenium/bidi/emulation/BUILD.bazel |
Test build configuration |
java/src/org/openqa/selenium/remote/BUILD.bazel |
Updated remote package dependencies |
java/src/org/openqa/selenium/bidi/module/BUILD.bazel |
Updated module package dependencies |
java/src/org/openqa/selenium/bidi/emulation/SetGeolocationOverrideParameters.java
Outdated
Show resolved
Hide resolved
java/src/org/openqa/selenium/bidi/emulation/GeolocationPositionError.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/bidi/emulation/EmulationTest.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/bidi/emulation/EmulationTest.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/bidi/emulation/EmulationTest.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/bidi/emulation/EmulationTest.java
Outdated
Show resolved
Hide resolved
e5300bf
to
7be9945
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
java/src/org/openqa/selenium/bidi/emulation/SetGeolocationOverrideParameters.java
Show resolved
Hide resolved
private final Double speed; | ||
|
||
// Constructor with default accuracy = 1.0 | ||
public GeolocationCoordinates( |
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.
Here also, 4 parameters are optional. So one way to do this would be to have a constructor with fixed parameters and having chained setters for the rest. When values are not set, use the default values mentioned in the spec.
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 am planning to go with telescoping constructors
db8804d
to
2892f69
Compare
User description
🔗 Related Issues
💥 What does this PR do?
Implements emulation BiDi spec in Java
🔧 Implementation Notes
Uses same BiDi approach which is used for other modules
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Implement BiDi emulation module for geolocation override
Add geolocation coordinates and error handling classes
Create comprehensive test suite for emulation functionality
Update build configurations for new emulation package
Diagram Walkthrough
File Walkthrough
4 files
Main emulation module class implementation
Geolocation coordinates data model with validation
Geolocation error handling model
Parameters class for geolocation override command
1 files
Comprehensive test suite for emulation functionality
5 files
Add SSL certificate handling for HTTPS testing
Build configuration for emulation package
Add emulation dependency to module build
Export emulation package in remote module
Test suite build configuration for emulation