Skip to content

test: cover month and week locator fills - #2723

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

test: cover month and week locator fills#2723
HaoChiBao wants to merge 1 commit into
browserbase:mainfrom
HaoChiBao:test/locator-fill-month-week

Conversation

@HaoChiBao

@HaoChiBao HaoChiBao commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add integration coverage for month and week inputs on the same value-setter path used by date.
  • Extend the RPC smoke fixture with #locator-month / #locator-week fill + inputValue asserts.
  • Leaves the existing date case alone to avoid colliding with test: cover time and datetime-local locator fills #2713 (time / datetime-local).

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 for 2026-01 (month) and 2026-W03 / 2026-W30 (week)

Summary by cubic

Add test coverage for filling month and week inputs via the same value-setter path as date, to prevent regressions when beforeinput blocks insertText. No runtime behavior changes.

  • RPC smoke test: adds #locator-month and #locator-week to the fixture and asserts locatorFill succeeds and locatorInputValue returns the filled values (“2026-07”, “2026-W30”).
  • SDK integration test: parametrized month/week case validates fill via value setter still works when a beforeinput handler prevents insertText (“2026-01”, “2026-W03”). Leaves the existing date case unchanged to avoid overlap with the open time/datetime-local work.

Written for commit 53f579b. Summary will update on new commits.

Review in cubic

Add value-setter coverage for input types that share the date fill path but were not asserted yet, without overlapping the open time/datetime-local fill PR.
@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 53f579b

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 Integration Test (SDK)
    participant SDK as Stagehand SDK
    participant RPC as RPC Client
    participant SW as Service Worker
    participant Browser as Browser Page
    participant Fixture as HTML Fixture

    Note over Test,Browser: NEW: Month/Week fill via value setter (beforeinput blocked)

    Test->>SDK: page.locator(input).fill("2026-01" / "2026-W03")
    SDK->>RPC: locatorFill(pageId, selector, value)
    RPC->>SW: RPC request
    SW->>Browser: Execute fill (value setter path)
    Browser->>Browser: beforeinput handler blocks insertText
    Browser->>Browser: Fallback to value setter
    Browser-->>SW: filled: true
    SW-->>RPC: Response
    RPC-->>SDK: Success
    SDK->>RPC: locatorInputValue(pageId, selector)
    RPC->>SW: RPC request
    SW->>Browser: Read input value
    Browser-->>SW: "2026-01" / "2026-W03"
    SW-->>RPC: Response
    RPC-->>SDK: Value confirmed
    SDK-->>Test: Assert value matches

    Note over Test,Browser: CHANGED: RPC smoke fixture extended

    Test->>RPC: locatorFill(#locator-month, "2026-07")
    RPC->>SW: RPC request
    SW->>Browser: Fill month input
    Browser-->>SW: filled: true
    SW-->>RPC: Response
    RPC-->>Test: Assert filled: true

    Test->>RPC: locatorInputValue(#locator-month)
    RPC->>SW: RPC request
    SW->>Browser: Read value
    Browser-->>SW: "2026-07"
    SW-->>RPC: Response
    RPC-->>Test: Assert "2026-07"

    Test->>RPC: locatorFill(#locator-week, "2026-W30")
    RPC->>SW: RPC request
    SW->>Browser: Fill week input
    Browser-->>SW: filled: true
    SW-->>RPC: Response
    RPC-->>Test: Assert filled: true

    Test->>RPC: locatorInputValue(#locator-week)
    RPC->>SW: RPC request
    SW->>Browser: Read value
    Browser-->>SW: "2026-W30"
    SW-->>RPC: Response
    RPC-->>Test: Assert "2026-W30"
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.

1 participant