microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.12k stars 3.69k forks source link

[Bug]: VSCode extension not reloading test code in text editor and showing false errors #33671

Open jaktestowac opened 3 days ago

jaktestowac commented 3 days ago

Version

1.49.0

Steps to reproduce

Start new project on Windows 11 machine with: npm init playwright@latest --yes '--' '--quiet' '--browser=chromium'

Make sure that you have Playwright Extension installed (tested on Playwright Test for VSCode v1.1.12)

Make changes to test script to make VSCode show some red underlines indicating that are problems with code. Use Ctr (Cmd) + Z to udo some actions if bug output will not appear. This is correct error - added const in line 4: Image

If incorrect code removed error persist: Image With hoover on error: Image

The problem disappears when navigating to Testing | TEST EXPLORER | Refresh Tests

This issue was observed with already fixed one: https://github.com/microsoft/playwright/issues/33531

Expected behavior

No errors displayed in code editor

Actual behavior

False error displayed, manual action required.

Additional context

All plugins except the Playwright Extension were turned off. All updates have been applied.

Sometimes several actions on the code need to be executed to trigger this error. It occurs on multiple machines, both Windows and macOS.

This bug appeared in previous extension releases, but recently it has been occurring frequently.

Use of W11 virtual machine can be needed: https://github.com/microsoft/playwright/issues/33531#issuecomment-2471339282

Reproduction may include executing installation of any Playwright version and browsers since this is somehow connected. In my case issue appeared after fresh Playwright installation. After some time was not reproducible and after triggering latest installation it appeared again.

Environment

VSCode with Playwright Test for VSCode v1.1.12
System:
    OS: Windows 11
    CPU: (16) x64 11th Gen Intel(R) Core(TM)
    Memory: 43.39 GB / 63.71 GB
  Binaries:
    Node: 20.11.0 - \nodejs\node.EXE
    npm: 10.4.0 - \nodejs\npm.CMD
  IDEs:
    VSCode: 1.95.3 - \Microsoft VS Code\bin\code.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
  npmPackages:
    @playwright/test: ^1.49.0