[dotnet] [bidi] Add SetScrollbarTypeOverride command in Emulation module#17171
[dotnet] [bidi] Add SetScrollbarTypeOverride command in Emulation module#17171nvborisenko wants to merge 1 commit intoSeleniumHQ:trunkfrom
Conversation
Review Summary by QodoAdd SetScrollbarTypeOverride command to BiDi Emulation module
WalkthroughsDescription• Adds SetScrollbarTypeOverride command to BiDi Emulation module • Introduces ScrollbarType enum with Classic and Overlay options • Implements command, parameters, options, and result types • Adds comprehensive unit tests for the new functionality File Changes1. dotnet/src/webdriver/BiDi/Emulation/SetScrollbarTypeOverrideCommand.cs
|
Code Review by Qodo
1. New IEmulationModule method
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for the emulation.setScrollbarTypeOverride WebDriver BiDi command, as defined in the W3C spec. It introduces new types and hooks them into the existing Emulation module infrastructure.
Changes:
- Introduces
ScrollbarTypeenum,SetScrollbarTypeOverrideCommand,SetScrollbarTypeOverrideParameters,SetScrollbarTypeOverrideOptions, andSetScrollbarTypeOverrideResulttypes - Wires up the new command in
EmulationModule(implementation) andIEmulationModule(interface), including[JsonSerializable]context registration - Adds two integration tests covering setting an explicit scrollbar type and resetting to default
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
SetScrollbarTypeOverrideCommand.cs |
New file defining command, parameters, options, result, and ScrollbarType enum |
EmulationModule.cs |
Adds SetScrollbarTypeOverrideAsync method and registers types in the JSON serializer context |
IEmulationModule.cs |
Adds SetScrollbarTypeOverrideAsync to the public interface |
EmulationTests.cs |
Adds CanSetScrollbarTypeOverride and CanSetScrollbarTypeOverrideToDefault integration tests |
| Task<SetNetworkConditionsResult> SetNetworkConditionsAsync(NetworkConditions? networkConditions, SetNetworkConditionsOptions? options = null, CancellationToken cancellationToken = default); | ||
| Task<SetScreenOrientationOverrideResult> SetScreenOrientationOverrideAsync(ScreenOrientation? screenOrientation, SetScreenOrientationOverrideOptions? options = null, CancellationToken cancellationToken = default); | ||
| Task<SetScreenSettingsOverrideResult> SetScreenSettingsOverrideAsync(ScreenArea? screenArea, SetScreenSettingsOverrideOptions? options = null, CancellationToken cancellationToken = default); | ||
| Task<SetScrollbarTypeOverrideResult> SetScrollbarTypeOverrideAsync(ScrollbarType? scrollbarType, SetScrollbarTypeOverrideOptions? options = null, CancellationToken cancellationToken = default); |
There was a problem hiding this comment.
1. New iemulationmodule method 📘 Rule violation ✓ Correctness
A new member was added to the public IEmulationModule interface, which is a breaking API/ABI change for any downstream implementations of that interface. Existing consumers implementing IEmulationModule will fail to compile (and may fail at runtime depending on binding/dispatch).
Agent Prompt
## Issue description
A new method was added to the public `IEmulationModule` interface, which is a breaking change for downstream implementers and violates API/ABI compatibility expectations.
## Issue Context
Downstream projects may implement `IEmulationModule`. Adding a new interface member forces them to update implementations, meaning they cannot upgrade by changing only the version number.
## Fix Focus Areas
- dotnet/src/webdriver/BiDi/Emulation/IEmulationModule.cs[22-33]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
https://w3c.github.io/webdriver-bidi/#command-emulation-setScrollbarTypeOverride
💥 What does this PR do?
Adds support for overriding the scrollbar type in the BiDi Emulation module. The main changes include the introduction of new command and result types, updates to the emulation interface and implementation, and new tests to verify the functionality.
🔄 Types of changes