Skip to content

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

@asolodova

Description

@asolodova

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy