playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] VSCode Extension broken with Playwright 1.34.1

Open rothsandro opened this issue 2 years ago • 2 comments

System info

  • Playwright Version: v1.34.1
  • Operating System: Windows 11
  • Browser: -
  • Other info:
    • VS Code: 1.78.2
    • Playwright Test for VSCode: 1.0.11

Source code

  • [x] I provided exact source code that allows reproducing the issue locally.

Link to the GitHub repository with the repro

https://github.com/rothsandro/repro.playwright-vscode

Steps

  1. Create a new folder and run npm init -y
  2. Run npm init playwright@latest and accept all default values
  3. Open the folder in VS Code
  4. Install Playwright Test for VSCode extension
  5. Open the Playwright panel to see all tests

Expected

The extension should show the example test.

Actual

  • No tests are shown
  • A toast "Please install Playwright Test ..." is shown

The problem only occurs with the latest version 1.34.1 of Playwright. It works when installing the previous version 1.34.0

rothsandro avatar May 23 '23 07:05 rothsandro

Same here (Apple M1 MacBook Pro, macOS Ventura 13.4, vscode v1.78.2, PW Test for vscode v1.0.11).

klhex avatar May 23 '23 13:05 klhex

Also seeing this on Ventura 13.3.1, vscode 1.78.2, Playwright 1.34.1, vscode PW Test extension v1.0.11.

I noticed this error in the vscode output tab under the "Window" section:

[error] [Extension Host] SyntaxError: Unexpected token 'u', "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at Oe.getPlaywrightInfo (/Users/{name}/.vscode/extensions/ms-playwright.playwright-1.0.11/out/extension.js:14:4037)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at We._rebuildModel (/Users/{name}/.vscode/extensions/ms-playwright.playwright-1.0.11/out/extension.js:84:13618)
    at We.activate (/Users/{name}/.vscode/extensions/ms-playwright.playwright-1.0.11/out/extension.js:84:12827)

JasonObeid avatar May 23 '23 17:05 JasonObeid

This might be caused by #23203, which changed the import path used by the extension here from @playwright/test/cli to @playwright/test/lib/cli (the "./cli": "./cli.js" entry was deleted from package.json).

tsznuk avatar May 23 '23 19:05 tsznuk

Same problem for v1.34.2

esd3v avatar May 24 '23 10:05 esd3v

Works fine for me with v1.34.2

rothsandro avatar May 24 '23 10:05 rothsandro