Skip to content

[rb] cover BiDi key, wheel, release, and setFiles scenarios in the Input spec - #18022

Merged
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:rb-bidi-input-spec
Sep 11, 2026
Merged

titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:rb-bidi-input-spec

Conversation

@titusfortner

Copy link
Copy Markdown
Member

🔗 Related Issues

💥 What does this PR do?

  • Adds tests of BiDi Input protocol, including multiple file upload scenario

🔧 Implementation Notes

  • Every example observes its result in the page; none subscribes to BiDi events.
  • The two-file example submits the form because value reports only the first file, and uses upload_multiple.html because Rack keeps only the last value of a repeated plain field name.
  • The releaseActions examples assert the state change a release causes instead of the command's empty result, which passed with nothing released.
  • The Python port's combined type-and-attach flow is left out: key actions and setFiles are independent commands, each covered here on its own.

🤖 AI assistance

  • AI assisted (complete below)
    • Tool(s): Claude Code (Fable 5.1)
    • What was generated: the gap analysis, tests, and this description
    • I reviewed all AI output and can explain the change

🔄 Types of changes

  • New feature (test coverage only, no library change)

@selenium-ci selenium-ci added C-rb Ruby Bindings B-devtools Includes everything BiDi or Chrome DevTools related labels Sep 11, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Cover Ruby BiDi key, wheel, release, and setFiles scenarios

🧪 Tests ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Covers BiDi keyboard, modifier, wheel, and release behavior through page-observable outcomes.
• Expands setFiles coverage for multiple files, events, repeated selections, and clearing.
• Allows temporary test files to carry scenario-specific content.
Diagram

sequenceDiagram
  participant S as Input Specs
  participant H as Test Helpers
  participant I as BiDi Input
  participant B as Browser Context
  participant P as Test Page
  S->>H: Create test files
  H-->>S: Return file paths
  S->>I: Send actions or files
  I->>B: Issue BiDi command
  B->>P: Apply input state
  P-->>S: Expose DOM result
Loading
High-Level Assessment

The page-observable integration approach is appropriate because it verifies user-visible command effects rather than only empty protocol responses. BiDi event subscriptions were reasonably avoided because they would couple these tests to unrelated event-domain behavior, while combining commands would make failures less isolated.

Files changed (2) +177 / -22

Tests (2) +177 / -22
input_spec.rbExpand BiDi Input integration scenarios +175/-20

Expand BiDi Input integration scenarios

• Adds reusable key and pointer action builders plus coverage for typing, modifier state, wheel scrolling, and pointer/key release effects. Extends setFiles tests to verify multiple uploads, change and cancel events, selection clearing, and resulting page state.

rb/spec/integration/selenium/webdriver/bidi/protocol/input_spec.rb

helpers.rbSupport custom temporary-file content +2/-2

Support custom temporary-file content

• Extends create_tempfile with an optional content argument while preserving its existing default. This lets multi-file upload tests assign distinct markers to each file.

rb/spec/integration/selenium/webdriver/spec_support/helpers.rb

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@titusfortner
titusfortner merged commit 27096ee into SeleniumHQ:trunk Sep 11, 2026
29 checks passed
This was referenced Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-devtools Includes everything BiDi or Chrome DevTools related C-rb Ruby Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants