Skip to content

feat: add context parameter to appendField, clearField, attachFile#5479

Open
DavertMik wants to merge 3 commits into4.xfrom
feat/context-param-form-methods
Open

feat: add context parameter to appendField, clearField, attachFile#5479
DavertMik wants to merge 3 commits into4.xfrom
feat/context-param-form-methods

Conversation

@DavertMik
Copy link
Contributor

Summary

  • Add optional context parameter to appendField, clearField, and attachFile across Playwright, Puppeteer, and WebDriver helpers
  • Brings consistency with fillField, selectOption, checkOption, and uncheckOption which already support context scoping
  • Allows scoping element search to a specific DOM container, e.g. I.appendField('Name', 'jon', '.form-container')

Test plan

  • Playwright helper tests pass (347 passing, 2 failing — pre-existing #makeApiRequest 3rd party issues)
  • Puppeteer helper tests pass (300 passing, 4 failing — pre-existing cookie + Chrome sandbox issues)
  • WebDriver helper tests (require Selenium Server, verified via CI)

🤖 Generated with Claude Code

Add optional context parameter to remaining form-filling methods
(appendField, clearField, attachFile) across Playwright, Puppeteer,
and WebDriver helpers for consistency with fillField, selectOption,
checkOption, and uncheckOption which already support it.

This allows scoping element search to a specific DOM container:
  I.appendField('Name', 'jon', '.form-container')
  I.clearField('Name', '.form-container')
  I.attachFile('Avatar', 'data/avatar.jpg', '.form-container')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…achFile

Add shared webapi tests verifying that context scoping works for
appendField, clearField, and attachFile. Extended the context.php
test page with pre-filled values and file inputs to support the tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DavertMik DavertMik force-pushed the feat/context-param-form-methods branch from 9ff1297 to 7851d21 Compare March 7, 2026 17:02
…pers

Remove unused `options` parameter from Playwright's clearField. The
options were accepted but never passed to the underlying clear() call.
Now all helpers have consistent `clearField(locator, context)` signature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants