Skip to content

Conversation

@inancgumus
Copy link
Contributor

@inancgumus inancgumus commented Nov 25, 2025

This PR continues from #5241. I've refactored the code to fix some remaining issues.

From the original PR (written by @rajan2345):

What?

Implements locator.pressSequentially() to type text character by character, simulating real keyboard input. This is useful for testing features like autocomplete, input validation, and character counters that require gradual typing.

Why?

This feature enables k6 users to test scenarios that require real keyboard events for each character, which locator.fill() doesn't provide. It's particularly useful when migrating from Playwright to k6, as this is a commonly used Playwright API that k6 currently lacks.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

Please do not merge this PR until the following items are filled out.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

Closes #5038

@inancgumus inancgumus force-pushed the add/locator-presssequentially branch from 9a79abd to 8f44cc1 Compare November 25, 2025 18:52
@inancgumus inancgumus temporarily deployed to azure-trusted-signing November 25, 2025 18:59 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing November 25, 2025 19:00 — with GitHub Actions Inactive
@inancgumus inancgumus changed the title Add/locator presssequentially Add locator.pressSequentially Nov 25, 2025
rajan2345 and others added 2 commits November 25, 2025 14:17
Implements locator.pressSequentially() to type text character by
character, simulating real keyboard input. This is useful for testing
features like autocomplete, input validation, and character counters
that require gradual typing.

Co-authored-by: Inanc Gumus <[email protected]>
This method is no different than locator.Type, which was deprecated by
Playwright.
@inancgumus inancgumus force-pushed the add/locator-presssequentially branch from 8f44cc1 to 20e9642 Compare November 25, 2025 19:17
@inancgumus inancgumus temporarily deployed to azure-trusted-signing November 25, 2025 19:23 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing November 25, 2025 19:25 — with GitHub Actions Inactive
@inancgumus inancgumus self-assigned this Nov 25, 2025
@inancgumus inancgumus added this to the v1.5.0 milestone Nov 25, 2025
@inancgumus inancgumus marked this pull request as ready for review November 25, 2025 19:48
@inancgumus inancgumus requested a review from a team as a code owner November 25, 2025 19:48
@inancgumus inancgumus requested review from ankur22 and codebien and removed request for a team November 25, 2025 19:48
@inancgumus
Copy link
Contributor Author

Thanks for the original PR @rajan2345. We'll include your name in the 1.5.0 release notes.

ankur22
ankur22 previously approved these changes Nov 26, 2025
Copy link
Contributor

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Thanks for the change @rajan2345! Thanks for taking over @inancgumus 🙇

@inancgumus inancgumus force-pushed the add/locator-presssequentially branch from 2fb66d2 to c876a74 Compare December 1, 2025 16:43
@inancgumus inancgumus temporarily deployed to azure-trusted-signing December 1, 2025 16:50 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing December 1, 2025 16:52 — with GitHub Actions Inactive
@inancgumus inancgumus requested a review from ankur22 December 1, 2025 20:27
@inancgumus inancgumus temporarily deployed to azure-trusted-signing December 2, 2025 16:59 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing December 2, 2025 17:01 — with GitHub Actions Inactive
@inancgumus inancgumus merged commit ad87293 into master Dec 3, 2025
44 of 48 checks passed
@inancgumus inancgumus deleted the add/locator-presssequentially branch December 3, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement locator.pressSequentially

4 participants