-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[rb] Set window state rb bidi #16700
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
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 setClientWindowState method for Ruby bindings, adding window state management functionality. The implementation introduces a new Window class to handle window operations like maximizing, minimizing, fullscreen, and resizing.
Key changes:
- Created a new
Windowclass to encapsulate window state and operations - Added methods for window state manipulation (maximize, minimize, fullscreen, resize)
- Integrated the new Window class into the Browser class, replacing the previous Struct-based implementation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rb/lib/selenium/webdriver/bidi/browser/window.rb | New Window class implementation with state management methods |
| rb/lib/selenium/webdriver/bidi/browser.rb | Updated to use new Window class and added window() method for retrieving active window |
| rb/sig/lib/selenium/webdriver/bidi/browser/window.rbs | Type signature definitions for the new Window class |
| rb/sig/lib/selenium/webdriver/bidi/browser.rbs | Updated type signatures to reflect Browser class changes |
| rb/spec/integration/selenium/webdriver/bidi/browser_spec.rb | Added integration tests for window state operations |
| rb/Rakefile | Modified bazel build command (appears incomplete) |
| rb/.vscode/settings.json | Added VSCode Ruby LSP configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7accf10 to
e3b55a2
Compare
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:
|
||||||||||||||||
0345b23 to
4b690c0
Compare
User description
💥 What does this PR do?
This PR adds support for the set window method specified on the BiDi implementation for the ruby bindings
The command is not implemented yet, so I couldn't fully tested but I looked at what we have in other bindings and is a start
🔧 Implementation Notes
I decided to create a window class, so the user can update one or more window properties easily
🔄 Types of changes
PR Type
Enhancement
Description
Refactors Window from Struct to dedicated class with BiDi integration
Adds window state management methods (maximize, minimize, fullscreen, resize)
Implements
browser.setClientWindowStateBiDi command supportAdds comprehensive test coverage for window state operations
Diagram Walkthrough
File Walkthrough
browser.rb
Refactor Window class and add window accessorrb/lib/selenium/webdriver/bidi/browser.rb
@windowinstance variable for caching active windowwindowmethod to retrieve active or first windowwindowsmethod to instantiate Window with BiDi referencewindow.rb
New Window class with state management methodsrb/lib/selenium/webdriver/bidi/browser/window.rb
set_statemethod for BiDibrowser.setClientWindowStatecommand
maximize,minimize,fullscreen,resizeupdate_attributesfor state synchronizationbrowser_spec.rb
Add window state operation testsrb/spec/integration/selenium/webdriver/bidi/browser_spec.rb
maximizewindow operationminimizewindow operationfullscreenwindow operationresizewindow with dimensionsset_statewith position parametersavailable
browser.rbs
Update Browser type signaturesrb/sig/lib/selenium/webdriver/bidi/browser.rbs
@windowinstance variable type annotationwindowsmethod signature returning Window arraywindowmethod signature returning optional Windowuser_contextsreturn type to Hash with arrayremove_user_contextreturn type annotationwindow.rbs
Add Window class type definitionsrb/sig/lib/selenium/webdriver/bidi/browser/window.rbs