Skip to content

fix(playwright): register payroll-settings listener before the settings click - #1691

Merged
renemadsen merged 1 commit into
stablefrom
fix/playwright-payroll-settings-race
Aug 28, 2026
Merged

fix(playwright): register payroll-settings listener before the settings click#1691
renemadsen merged 1 commit into
stablefrom
fix/playwright-payroll-settings-race

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

  • Fixes the consistently failing pn-playwright-test (j) and pn-playwright-test (j1m) jobs in run 33082638121Test timeout of 120000ms exceeded while running "beforeEach" hook.
  • Root cause: the beforeEach hook in j/dashboard-edit-a.spec.ts (and the j1m clone) registered page.waitForResponse() for the payroll-settings GET only after already awaiting the main settings GET. The settings component's ngOnInit fires getSettings() and getPayrollSettings() synchronously back-to-back, so the payroll GET had usually already completed by the time the listener was armed — leaving it unresolved for the full 120s test timeout (playwright.config.ts sets no per-action timeout) and killing the browser mid-hook.
  • Fix: register both waitForResponse listeners before the #plugin-settings-link0 click, so neither response can complete unobserved. Dropped the .catch(() => {}) on the payroll listener since the call is unconditional and now guaranteed to be caught.
  • This was a regression introduced by d42fdfe, already merged to stable.

Test plan

  • Code review subagent verified the fix against time-planning-settings.component.ts's ngOnInit (confirms both GETs are unconditional and fire only after the settings-link click mounts the component) — no critical/important issues found.
  • CI run on this PR (pn-playwright-test (j) and (j1m)) passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WYHEYf7V1oJyPrLRLAWg6e

…gs click

The j/ and j1m/ dashboard-edit-a beforeEach hooks registered the
page.waitForResponse() listener for the payroll-settings GET only after
already awaiting the main settings GET. Since the settings component's
ngOnInit fires both requests synchronously back-to-back, the payroll GET
usually already completed by the time the listener was armed, leaving it
unresolved for the full 120s test timeout (no per-action timeout is
configured) and killing the browser mid-hook. Register both listeners
before the click so neither response can complete unobserved.

Fixes the consistent job/j and pn-playwright-test (j1m) failures in
https://github.com/microting/eform-angular-timeplanning-plugin/actions/runs/33082638121

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYHEYf7V1oJyPrLRLAWg6e
Copilot AI lite review requested due to automatic review settings August 28, 2026 06:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Playwright test flake in the time-planning plugin E2E suite by ensuring network response listeners are registered before the UI click that triggers the relevant Angular component initialization, preventing missed responses and 120s beforeEach timeouts.

Changes:

  • Register the payroll settings page.waitForResponse() listener before clicking into settings, alongside the existing settings listener.
  • Replace the post-settings waitForResponse(...).catch(() => {}) with an awaited pre-registered promise in both j and j1m variants.
  • Add an in-test comment documenting the race condition and why listener registration order matters here.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
eform-client/playwright/e2e/plugins/time-planning-pn/j/dashboard-edit-a.spec.ts Arms payroll settings response listener before the settings click to avoid missed responses in beforeEach.
eform-client/playwright/e2e/plugins/time-planning-pn/j1m/dashboard-edit-a.spec.ts Applies the same listener-order fix to the j1m shard clone to prevent identical timeouts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@renemadsen
renemadsen merged commit 7e8d5d8 into stable Aug 28, 2026
76 of 78 checks passed
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