Skip to content

Conversation

inancgumus
Copy link
Contributor

@inancgumus inancgumus commented Oct 15, 2025

What?

  • Adds Page.waitForEvent for waiting until a PageEvent occurs.
  • Enables WaitForResponse to use the existing PageEvent handling system.
  • Removes duplicated page response event handling mechanics and a goroutine.
  • Renames related page event handling types for consistency with the refactored code.

Why?

  • Improves the module's maintainability by using the existing event handling system.
  • Unlocks future WaitForX methods, such as WaitForEvent.

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

Related PR(s)/Issue(s)

@inancgumus inancgumus added this to the v1.4.0 milestone Oct 15, 2025
@inancgumus inancgumus self-assigned this Oct 15, 2025
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 15, 2025 20:50 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 15, 2025 20:53 — with GitHub Actions Inactive
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from b5237f2 to b736ccc Compare October 15, 2025 23:46
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 15, 2025 23:52 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 15, 2025 23:54 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 16, 2025 00:01 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 16, 2025 00:03 — with GitHub Actions Inactive
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from 9bdc188 to 2d2008b Compare October 16, 2025 00:59
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 16, 2025 01:05 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 16, 2025 01:06 — with GitHub Actions Inactive
@inancgumus inancgumus force-pushed the refactor/pattern-matcher branch 2 times, most recently from 7f404c6 to 2b264b0 Compare October 16, 2025 15:58
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from 2d2008b to 091e994 Compare October 17, 2025 12:17
@inancgumus inancgumus force-pushed the refactor/pattern-matcher branch from 2b264b0 to bfcfcf4 Compare October 17, 2025 12:18
Base automatically changed from refactor/pattern-matcher to master October 20, 2025 12:50
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from 091e994 to edf18be Compare October 20, 2025 12:52
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 20, 2025 12:57 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 20, 2025 13:00 — with GitHub Actions Inactive
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch 2 times, most recently from e4576d7 to 4144282 Compare October 20, 2025 17:43
@inancgumus inancgumus changed the title Add Page.waitForEvent Add Page.waitForEvent by refactoring page event handling Oct 20, 2025
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 20, 2025 17:48 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 20, 2025 17:53 — with GitHub Actions Inactive
@inancgumus inancgumus marked this pull request as ready for review October 20, 2025 19:43
@inancgumus inancgumus requested a review from a team as a code owner October 20, 2025 19:43
@inancgumus inancgumus requested review from ankur22, joanlopez and oleiade and removed request for a team and ankur22 October 20, 2025 19:43
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from 4144282 to e22220b Compare October 20, 2025 23:15
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 20, 2025 23:21 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 20, 2025 23:23 — with GitHub Actions Inactive
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from e22220b to 04ce63f Compare October 21, 2025 13:33
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 21, 2025 13:39 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 21, 2025 13:41 — with GitHub Actions Inactive
We'll use this method later for all page event handling methods, such as
WaitForResponse and WaitForRequest. Implementing it also unlocks us to
easily implement WaitForEvent in the future.
This functionality is a duplication of the existing page.on event system
and complicates the page.on event handling system. Using the existing
event handling system makes the code coherent with the existing and
future functionality.
We no longer use events only for Page.On. Events are generic and belongs
to a Page. So, they're now called just page events.
@inancgumus inancgumus force-pushed the add/page-wait-for-event branch from 04ce63f to 0815ace Compare October 21, 2025 15:44
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 21, 2025 15:50 — with GitHub Actions Inactive
@inancgumus inancgumus temporarily deployed to azure-trusted-signing October 21, 2025 15:52 — with GitHub Actions Inactive
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.

1 participant