#24
fix: prevent type action text from being used as element locator
Summary
- Fixes a bug where the
typeaction'stextfield (intended as content to type) is incorrectly passed toresolveTarget, which interprets it as an element locator - When both
textandselectorare provided on atypestep,resolveTargetcheckstextfirst and fails withElement not found: text="<typed content>" - The fix passes only
{ selector, within }toresolveTarget, keepingtextreserved for the content to type
Reproduction
{
"action": "type",
"text": "user@example.com",
"selector": "#email"
}This fails with:
Element not found: text="user@example.com"Because resolveTarget receives the full step object and prioritizes opts.text (line 81 of runner.ts) over opts.selector, treating the typed content as an element search query.
Fix
- const box = await resolveTarget(client, step);
+ const box = await resolveTarget(client, { selector: step.selector, within: step.within });Test plan
- Verify
typeaction with bothtextandselectorcorrectly types into the targeted element - Verify
typeaction withoutselectorstill works (no change to that path) - Verify existing
click,hover,moveToactions still resolve elements correctly (unchanged)
🤖 Generated with Claude Code
@sow-akash-mole is attempting to deploy a commit to the Vercel Labs Team on Vercel.
A member of the Team first needs to authorize it.