Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
asolodova opened this issue Apr 22, 2025 · 0 comments

Comments

@asolodova
Copy link

asolodova commented Apr 22, 2025

Summary: Popups triggered during a test execution are not isolated between sequentially executed tests, leading to state leakage. This results in false positives or negatives when verifying popup content in subsequent tests.
This using method I.seeInPopup(text)

Environment:

  • CodeceptJS v3.7.3
  • nodeInfo: 22.14.0
  • osInfo: macOS 15.2
  • cpuInfo: (8) arm64 Apple M1
  • chromeInfo: 135.0.7049.96
  • edgeInfo: Not Found
  • firefoxInfo: undefined
  • safariInfo: 18.2
  • playwrightBrowsers: "chromium: 131.0.6778.33, firefox: 132.0, webkit: 18.2"
 "Playwright": {
  "getPageTimeout": 30000,
  "keepBrowserState": false,
  "keepTraceForPassedTests": false,
  "keepVideoForPassedTests": false,
  "restart": false,
  "show": true,
  "testDir": "./tests",
  "trace": true,
  "url": "http://localhost",
  "video": false,
  "waitForAction": 100,
  "waitForNavigation": "load",
  "waitForTimeout": 10000,
  "windowSize": "1280x720"
 },

Steps to Reproduce:
Test 1:

  • Launches a browser.
  • Executes steps that trigger a confirmation popup.
  • Does not call acceptPopup() explicitly.
  • Continues execution assuming the popup was implicitly accepted.

Test 2:

  • Runs immediately after Test 1 in the same environment.
  • Launches a new browser session.
  • Triggers a similar popup.
  • Verifies the text content of the popup.

Expected Behavior:

Popups in Test 1 and Test 2 should be isolated. The popup in Test 2 should reflect only the state and content triggered during that test.

Actual Behavior:

The popup in Test 2 contains the text/content from the popup triggered in Test 1. This occurs even though a new browser session is initiated in each test.

Related Error:

Error processing test.failed event:
DataCloneError: () => {
    const params = this.params || {}
    const msg = params.customMessage || ''
    return msg + subs(t...<omitted>...) } could not be cloned.
    at new DOMException (node:internal/per_context/domexception:53:5)
    at sendToParentThread (/path/to/codeceptjs/lib/command/workers/runTests.js:120:15)
    at EventEmitter.<anonymous> (/path/to/codeceptjs/lib/command/workers/runTests.js:90:57)
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

No branches or pull requests

1 participant