Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 1, 2025

  • Analyze the popup isolation issue in CodeceptJS
  • Understand the root cause: global popupStore state persistence between tests
  • Create test to demonstrate the issue
  • Implement minimal fix: clear popupStore in _after method for Playwright helper
  • Implement minimal fix: clear popupStore in _after method for Puppeteer helper
  • Test the fix works properly with comprehensive simulation tests
  • Verify existing tests still pass and code passes linting

Summary

Fixed popup state leakage between sequentially executed tests in both Playwright and Puppeteer helpers.

Root Cause: The popupStore is a global singleton that was never cleared between tests, causing the Popup class setter to ignore new popups when one already existed.

Fix: Added popupStore.clear() call in the _after() method of both helpers to ensure clean popup state between tests.

Changes Made:

  • lib/helper/Playwright.js: Added popup state clearing in _after() method (3 lines added)
  • lib/helper/Puppeteer.js: Added popup state clearing in _after() method (3 lines added)

The fix is minimal, surgical, and preserves all existing functionality while preventing popup state leakage between tests.

Fixes #4971.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI requested a review from kobenguyent September 1, 2025 06:04
@kobenguyent kobenguyent marked this pull request as ready for review September 1, 2025 06:20
@kobenguyent kobenguyent merged commit bc1c500 into 3.x Sep 1, 2025
14 checks passed
@kobenguyent kobenguyent deleted the copilot/fix-4971 branch September 1, 2025 06:20
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.

Popups triggered during a test execution are not isolated between sequentially executed tests, leading to state leakage
2 participants