Skip to content

[Bug]: PlayWright extension for VSCode showing 'no tests have been found' #40226

@hgargova

Description

@hgargova

Version

1.58.0

Steps to reproduce

System info

  • OS: Windows 11 (OS: Windows_NT x64 10.0.26200)
  • VS Code version: issue is present with 1.114.0, 1.115.0, 1.116.0
  • Playwright version: (1.58.0)
  • Playwright VS Code extension version: 1.1.17

Describe the bug

Playwright VS Code extension fails to load tests and shows errors in playwright.config.ts, even though everything works correctly from CLI.
In Testing tab:

  • No tests are shown
    In editor:
  • playwright.config.ts shows error:
    connect ETIMEDOUT ::1:<port> playwright
    In Developer Tools console:
    [ms-playwright.playwright] Illegal argument: character must be non-negative

Steps to reproduce

  1. Create a clean project:
    mkdir pw-smoke
    cd pw-smoke
    npm init -y
    npm i -D @playwright/test
    npx playwright install

  2. Create playwright.config.ts:

import { defineConfig } from '@playwright/test';
export default defineConfig({
  testDir: './tests',
});
Create tests/smoke.spec.ts:
import { test, expect } from '@playwright/test';
test('smoke', async ({ page }) => {
  await page.goto('https://example.com');
  await expect(page).toHaveTitle(/Example/);
});
Open project in VS Code
Install Playwright extension

### Expected behavior

Expected behavior
Tests should appear in Testing tab
No errors in playwright.config.ts


### Actual behavior

Actual behavior
No tests in Testing tab
Editor shows connect ETIMEDOUT ::1:<port>
Extension crashes with:
Illegal argument: character must be non-negative


### Additional context

Additional info
npx playwright test --list works correctly
Tests run successfully from CLI
Disabling Playwright extension removes the error in the editor
Issue reproduces even in a clean project
Reinstalling VS Code and extension does not fix the issue

### Environment

```shell
System:
OS: Windows 11 Enterprise 10.0.26200
CPU: (18) x64

Binaries:
Node: 20.20.0 - C:\nvm4w\nodejs\node.exe
npm: 10.8.2 - C:\nvm4w\nodejs\npm.cmd

npmPackages:
@playwright/test: 1.58.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions