[rb] Set window state rb bidi
💥 What does this PR do?
This PR adds support for the set window method specified on the BiDi implementation for the ruby bindings
🔧 Implementation Notes
I decided to create a window class, so the user can update one or more window properties easily
🔄 Types of changes
- New feature (non-breaking change which adds functionality and tests!)
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
| Security Compliance | |
| 🟢 | No security concerns identifiedNo security vulnerabilities detected by AI analysis. Human verification advised for critical code. |
| Ticket Compliance | |
| ⚪ | 🎫 No ticket provided
|
| Codebase Duplication Compliance | |
| ⚪ | Codebase context is not definedFollow the guide to enable codebase context checks. |
| Custom Compliance | |
| 🟢 |
Generic: Meaningful Naming and Self-Documenting CodeObjective: Ensure all identifiers clearly express their purpose and intent, making code Status: Passed
|
Generic: Secure Error HandlingObjective: To prevent the leakage of sensitive system information through error messages while Status: Passed
| |
Generic: Secure Logging PracticesObjective: To ensure logs are useful for debugging and auditing without exposing sensitive Status: Passed
| |
| ⚪ | Generic: Comprehensive Audit TrailsObjective: To create a detailed and reliable record of critical system actions for security analysis Status: Referred Code
|
Generic: Robust Error Handling and Edge Case ManagementObjective: Ensure comprehensive error handling that provides meaningful context and graceful Status: Referred Code
| |
Generic: Security-First Input Validation and Data HandlingObjective: Ensure all data inputs are validated, sanitized, and handled securely to prevent Status: Referred Code
| |
| |
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| Possible issue |
Refresh window state after modificationAfter calling rb/lib/selenium/webdriver/bidi/browser/window.rb [43-49]
Suggestion importance[1-10]: 9__ Why: The suggestion correctly identifies that optimistically updating attributes in | High |
Replace optimistic update with state refreshReplace the rb/lib/selenium/webdriver/bidi/browser/window.rb [67-75]
Suggestion importance[1-10]: 9__ Why: This suggestion provides a robust implementation for fixing the inconsistent state issue by replacing the optimistic | High | |
Remove caching to prevent stale dataRemove memoization from the rb/lib/selenium/webdriver/bidi/browser.rb [67-69]
Suggestion importance[1-10]: 8__ Why: The suggestion correctly identifies a bug where caching the window object via | Medium | |
| High-level |
Window state is updated optimisticallyThe Examples:rb/lib/selenium/webdriver/bidi/browser/window.rb [43-49]
Solution Walkthrough:Before:
After:
Suggestion importance[1-10]: 8__ Why: This is a valid and significant design suggestion that correctly identifies a potential for state inconsistency, which could lead to subtle bugs. | Medium |
| ||