Skip to content
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

[Bug]: Error: locator.click: Target page, context or browser has been closed #34232

Open
Maymanaf opened this issue Jan 7, 2025 · 3 comments

Comments

@Maymanaf
Copy link

Maymanaf commented Jan 7, 2025

Version

1.49.1

Steps to reproduce

  1. Clone my repo at : https://github.com/Maymanaf/osrd-fork.git
  2. docker compose up -d --build
  3. cd front
  4. run the tests

Expected behavior

All the test should run in both version 1.43.1 and 1.49.1

Actual behavior

when upgrading playwright version from 1.43.1 to 1.49.1 I got those two errors : Error: locator.click: Target page, context or browser has been closed or Error: locator.click: Target crashed .
These errors are reproducible only with WebKit. I can replicate the issue locally, on the CI, and even with the Playwright Docker image
It fails in this part:

Error: locator.click: Target page, context or browser has been closed
  Call log:
    - waiting for getByTestId('return-simulation-result')
      - locator resolved to <button type="button" class="btn btn-secondary btn-block" data-testid="return-simulation-result">…</button>
    - attempting click action
      - waiting for element to be visible, enabled and stable at pages/operational-studies-page-model.ts:106

    104 |
    105 |   async returnSimulationResult() {
> 106 |     await this.returnSimulationResultButton.click();
        |                                             ^
    107 |   }
    108 |
    109 |   async checkPathfindingDistance(distance: string | RegExp) {
      at OperationalStudiesPage.returnSimulationResult (/app/front/tests/pages/operational-studies-page-model.ts:106:45)
      at /app/front/tests/012-op-simulation-settings-tab.spec.ts:342:34

Additional context

I’ve already enabled and verified the rule:
"@typescript-eslint/no-floating-promises": "error"
to ensure no await statements are missing. you can also check the trace

Environment

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (12) x64 AMD Ryzen 5 PRO 5675U with Radeon Graphics
    Memory: 4.12 GB / 7.16 GB
    Container: Yes
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    Yarn: 1.22.22 - ~/osrd/front/node_modules/.bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
  IDEs:
    VSCode: 1.94.2 - /home/maymanaf/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/bin/remote-cli/code
  Languages:
    Bash: 5.0.17 - /usr/bin/bash
  npmPackages:
    @playwright/test: ^1.49.1 => 1.43.1
@Skn0tt
Copy link
Member

Skn0tt commented Jan 7, 2025

Sounds like an application bug to me, not a Playwright bug. If you believe it's a Playwright bug, please provide a self-contained reproduction, which we can run locally to reproduce your issue. Thanks for your understanding!

@Maymanaf
Copy link
Author

Maymanaf commented Jan 7, 2025

@Skn0tt I’ve added the repository to reproduce the issue locally.
PS: The tests work fine with version 1.43.1, but after updating to 1.49.1, they fail exclusively on WebKit. (Note: The tests pass in headed mode.)

@Skn0tt
Copy link
Member

Skn0tt commented Jan 7, 2025

That repository isn't minimal, it contains much more than just the purported bug. Please try recreating the bug in a blank project.

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

2 participants