test: cover month and week locator fills - #2723
Open
HaoChiBao wants to merge 1 commit into
Open
Conversation
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.
|
Contributor
There was a problem hiding this comment.
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
monthandweekinputs on the same value-setter path used bydate.#locator-month/#locator-weekfill +inputValueasserts.datecase 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.tspnpm --filter @browserbasehq/stagehand-protocol exec vitest run packages/protocol/tests/browser-runtime/rpc-client-smoke.test.ts2026-01(month) and2026-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.
#locator-monthand#locator-weekto the fixture and assertslocatorFillsucceeds andlocatorInputValuereturns the filled values (“2026-07”, “2026-W30”).Written for commit 53f579b. Summary will update on new commits.