xk6-browser icon indicating copy to clipboard operation
xk6-browser copied to clipboard

Add `.clear()` to Locator API

Open mdcruz opened this issue 1 year ago • 0 comments

Feature Description

Playwright's Locator API contains more methods that are useful for browser testing, such as:

  • .clear() for clearing text inputs

When typing or filling textboxes or input fields, it's useful to clear existing fields in case they already have values.

Suggested Solution (optional)

https://playwright.dev/docs/api/class-locator#locator-clear

Already existing or connected issues / PRs (optional)

No response

### Tasks
- [x] Implement new API -- https://github.com/grafana/xk6-browser/pull/1149
- [x] Add to release notes -- https://github.com/grafana/k6/pull/3524
- [x] Add documentation -- https://github.com/grafana/k6-docs/pull/1468
- [x] Add type definitions -- https://github.com/grafana/k6-DefinitelyTyped/commit/6d7f3241527d832e2302463a7fb9876902d3624e & https://github.com/grafana/k6-DefinitelyTyped/pull/24

mdcruz avatar Nov 27 '23 15:11 mdcruz