Skip to content

test: cover time and datetime-local locator fills - #2713

Open
HaoChiBao wants to merge 1 commit into
browserbase:mainfrom
HaoChiBao:test/locator-fill-time-datetime
Open

test: cover time and datetime-local locator fills#2713
HaoChiBao wants to merge 1 commit into
browserbase:mainfrom
HaoChiBao:test/locator-fill-time-datetime

Conversation

@HaoChiBao

@HaoChiBao HaoChiBao commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • pnpm --filter @browserbasehq/stagehand exec vitest run packages/sdk-ts/tests/integration/locatorFill.test.ts
  • pnpm --filter @browserbasehq/stagehand-protocol exec vitest run packages/protocol/tests/browser-runtime/rpc-client-smoke.test.ts
  • Confirm fills persist via inputValue() for date, time, and datetime-local

Closes #1249


Summary by cubic

Extends test coverage to verify Locator.fill for time and datetime-local inputs and exercises the RPC value-setter path end-to-end. Previously only date was covered; now all three are filled and persist even when beforeinput blocks insertText.

  • Integration: parameterized test in packages/sdk-ts/tests/integration/locatorFill.test.ts covers date, time, and datetime-local via the value setter under a blocked insertText path.
  • RPC smoke: fills and reads back #locator-date, #locator-time, and #locator-datetime-local; adds these inputs to the fixture HTML in packages/protocol/tests/browser-runtime/rpc-client-smoke.test.ts.
  • Test-only change; no runtime behavior impact. Completes the remaining input types from Fill on <input type="date"> and <input type="time"> confirmed not working #1249.

Written for commit d65d5a1. Summary will update on new commits.

Review in cubic

Extend date fill coverage so browserbase#1249's remaining input types share the same value-setter assertions in integration and RPC smoke tests.
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d65d5a1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Test as SDK Integration Test
    participant Page as Playwright Page
    participant RPC as RPC Client(s)
    participant Runtime as Browser Runtime
    participant DOM as DOM Input Element
    
    Note over Test,DOM: Locator Fill Flow for Date/Time/Datetime-local
    
    Test->>Page: goto(data URL with input + beforeinput blocker)
    Test->>Page: locator("xpath=/html/body/input")
    Test->>RPC: locatorFill(pageId, selector, value)
    RPC->>Runtime: activeRpcClient.send(locatorFill)
    Runtime->>Runtime: Identify input type (date|time|datetime-local)
    alt insertText blocked by beforeinput handler
        Runtime->>DOM: Set value directly via value setter
        DOM-->>Runtime: input value updated
    else insertText allowed (no blocker)
        Runtime->>DOM: Dispatch insertText input event
    end
    Runtime-->>RPC: { filled: true }
    RPC-->>Test: Fill confirmed
    
    Note over Test,DOM: Verification Flow
    
    Test->>RPC: locatorInputValue(pageId, selector)
    RPC->>Runtime: activeRpcClient.send(locatorInputValue)
    Runtime->>DOM: Read current value
    DOM-->>Runtime: value string
    Runtime-->>RPC: date|time|datetime-local value
    RPC-->>Test: Input value matches expected
    
    Note over RPC,DOM: RPC Smoke Test Flow (protocol package)
    
    Test->>RPC: locatorFill for #locator-date, #locator-time, #locator-datetime-local
    RPC->>Runtime: Send fill commands with values
    Runtime->>DOM: Set values on fixture inputs
    DOM-->>Runtime: Confirm fills
    Runtime-->>RPC: { filled: true }
    Test->>RPC: locatorInputValue for each input
    RPC->>Runtime: Read back values
    Runtime-->>RPC: Return values
    RPC-->>Test: Assert values persist (2026-07-21, 14:30, 2026-07-21T09:15)
Loading

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fill on <input type="date"> and <input type="time"> confirmed not working

1 participant