Skip to content

[Claimed #2012] fix(cli): support multi-value selection in browse select#2033

Open
github-actions[bot] wants to merge 2 commits intomainfrom
external-contributor-pr-2012
Open

[Claimed #2012] fix(cli): support multi-value selection in browse select#2033
github-actions[bot] wants to merge 2 commits intomainfrom
external-contributor-pr-2012

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Mirrored from external contributor PR #2012 after approval by @pirate.

Original author: @BABTUNA
Original PR: #2012
Approved source head SHA: 1271e2d5037b95a8d13c2f7fa20b2ea69caaa2a9

@BABTUNA, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here.

Original description

Summary

  • Fix browse select to honor all provided values instead of only the first
    one.
  • Add a regression test covering multi-select behavior.

Problem

browse select accepts variadic values (<values...>), but implementation
only forwarded values[0], so multi-select usage was broken :{.

Changes

  • Updated CLI select execution to call deepLocator(...).selectOption(...)
    with:
    • a single string for one value
    • a string array for multiple values
  • Added a CLI test that:
    • opens a page with a runs browse select select red blue verifies both values are selected Files Changed packages/cli/src/index.ts packages/cli/tests/cli.test.ts Validation Prettier check passed on touched files. CLI build passed. Summary by cubic Fixes multi-value selection across the CLI and core so multi-select dropdowns honor all provided values. browse select and the deterministic dropdown action now select all specified options. Bug Fixes CLI: Call page.deepLocator(...).selectOption with a single string or string[], and return the selected values. Core: Support multi-select in selectOptionFromDropdown by forwarding all args to locator.selectOption; adds CLI and core tests verifying multi-select (e.g., "red" and "blue"). Written for commit 1271e2d. Summary will update on new commits. Review in cubic

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

This mirrored PR tracks external contributor PR #2012 at source SHA 1271e2d5037b95a8d13c2f7fa20b2ea69caaa2a9, approved by @pirate.
Original PR: #2012

When the external PR gets new commits, this same internal PR will be refreshed in place after the latest external commit is approved.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

⚠️ No Changeset found

Latest commit: 1271e2d

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

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant User as CLI User
    participant CLI as CLI (executeCommand)
    participant Core as Core (actHandlerUtils)
    participant Playwright as Browser (Page/Locator)

    Note over User,Playwright: Multi-Value Selection Flow

    User->>CLI: browse select "selector" val1 val2
    
    CLI->>CLI: Parse variadic args into string array
    
    alt NEW: CLI Direct Interaction
        CLI->>Playwright: deepLocator(selector)
        Playwright-->>CLI: locator instance
        
        alt values.length == 1
            CLI->>Playwright: selectOption(value)
        else values.length > 1 (NEW)
            CLI->>Playwright: CHANGED: selectOption([val1, val2, ...])
        end
        
        Playwright-->>CLI: Array of selected values
    end

    Note over CLI,Core: Internal Core Action Flow

    opt Understudy / Deterministic Action
        Core->>Core: selectOption(ctx)
        Note right of Core: ctx.args contains multiple values
        
        alt values.length <= 1
            Core->>Playwright: selectOption(text)
        else values.length > 1 (NEW)
            Core->>Playwright: CHANGED: selectOption(string[])
        end
        
        Playwright-->>Core: void
    end

    CLI-->>User: { "selected": ["val1", "val2"] }
Loading

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

Labels

external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants