[rb] add low-level BiDi protocol integration specs - #17878
Conversation
PR Summary by QodoAdd Ruby BiDi protocol integration specs with strict serialization errors
AI Description
Diagram
High-Level Assessment
Files changed (20)
|
Code Review by Qodo
1.
|
… handle_user_prompt specs
|
Code review by qodo was updated up to the latest commit 187b2c4 |
| result = Permissions.new(driver).set_permission( | ||
| descriptor: Permissions::PermissionDescriptor.new(name: 'geolocation'), | ||
| state: :granted, | ||
| origin: url_for('blank.html') |
There was a problem hiding this comment.
1. Invalid origin in probe 🐞 Bug ≡ Correctness
The Safari permissions support probe passes url_for('blank.html') (a full URL with a path) as
origin, so when Safari implements permissions.setPermission the probe can still fail with
invalid-argument behavior and never signal support.
This breaks the probe’s purpose of flipping from pending to fixed when support lands.
Agent Prompt
### Issue description
The Safari permissions support probe uses `origin: url_for('blank.html')`, but `url_for` returns a full URL (including a path). The existing permissions integration spec derives `origin` from `window.location.origin` (origin-only). If Safari implements the command and validates `origin`, the probe may continue failing and will not provide the intended “support landed” signal.
### Issue Context
- The probe should send a *valid* payload so that success indicates module support.
- Existing integration coverage shows `origin` should be `window.location.origin`.
### Fix Focus Areas
- rb/spec/integration/selenium/webdriver/bidi/protocol/safari_support_probe_spec.rb[60-68]
### Suggested change
1. Navigate to a known page (e.g., `blank.html`).
2. Compute origin via JS: `driver.execute_script('return window.location.origin')`.
3. Pass that value as `origin:` to `set_permission` (and similarly for `embedded_origin` if used later).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 4f5d62b |
|
Code review by qodo was updated up to the latest commit 8094039 |
🔗 Related Issues
💥 What does this PR do?
Protocolintegration specs covering every command across all domains, exercised happy-path against real browsers.SerializationErrorinstead of a bareWebDriverError.🔧 Implementation Notes
UnknownCommandError— command or whole module the browser doesn't recognizeUnsupportedOperationError— recognized but not implemented / not permittedSerializationError— malformed or incomplete response (surfaced by strict mode)pendingguards that flip to a failure the moment a browser starts supporting the command — a built-in "support landed" signal.skipper browser+OS (notpending), so they don't burn the full timeout every run.Cells show the error class the guard asserts (linked where a bug is filed);
n/a= works.*describes Windows behavior where different (TimeoutError*= works elsewhere but times out on Windows and is skipped there).emulation.setForcedColorsModeThemeOverrideUnsupportedOperationErrorUnsupportedOperationErrorUnknownCommandErroremulation.setGeolocationOverride(error:)InvalidArgumentErroremulation.setScriptingEnabledUnknownCommandErroremulation.setScrollbarTypeOverrideUnknownCommandErrorUnknownCommandErroremulation.setTouchOverrideUnknownCommandErrorbrowsingContext.setBypassCSPUnsupportedOperationErrorUnknownCommandErrorUnknownCommandErrorbrowsingContext.startScreencastUnsupportedOperationErrorUnknownCommandErrorbrowsingContext.reload(ignoreCache: true)UnsupportedOperationErrorinput.setFilesUnsupportedOperationErrorwebExtension.install(archivePath / base64)UnsupportedOperationErrorUnsupportedOperationErroruserAgentClientHints.setClientHintsOverrideUnknownCommandErrorbluetooth.*(entire module)UnknownCommandErrorbluetooth.*(device-response commands)TimeoutError*TimeoutError*UnknownCommandErrorbrowser.setDownloadBehavior(file download)TimeoutError*TimeoutError*TimeoutError*browser.closeUnsupportedOperationErrorsession.endUnsupportedOperationError🤖 AI assistance
💡 Additional Considerations
SerializationError) or are unimplemented; those are guardedpendingso they signal when Safari catches up.🔄 Types of changes