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
66.79k stars 3.66k forks source link

[Bug]: Seeing ANSI codes in debug console when running Playwright tests #33181

Open pmeera5623 opened 2 weeks ago

pmeera5623 commented 2 weeks ago

Version

1.48.1

Steps to reproduce

While running Playwright tests in VS code in Debug mode, it throws ANSI characters like below in Debug console:

\x1b[2mRunning \x1b[22m1\x1b[2m test using \x1b[22m1\x1b[2m worker\x1b[22m How to get rid of these? These were not appearing before

Expected behavior

I expect to see output like: Running test using 1 worker

Actual behavior

\x1b[2mRunning \x1b[22m1\x1b[2m test using \x1b[22m1\x1b[2m worker\x1b[22m

Additional context

No response

Environment

System: OS: Windows 10 10.0.19045 CPU: (12) x64 AMD Ryzen 5 5625U with Radeon Graphics Memory: 1.51 GB / 13.86 GB Binaries: Node: 18.16.0 - C:\Program Files\nodejs\node.EXE npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD IDEs: VSCode: 1.94.2 - C:\Program Files\Microsoft VS Code\bin\code.CMD npmPackages: @playwright/test: ^1.48.1 => 1.48.1

mxschmitt commented 2 weeks ago

Investigation notes:

      await this._vscode.debug.startDebugging(undefined, {
        type: 'pwa-node',
        name: debugSessionName,
        request: 'launch',
        cwd: paths.cwd,
        env: {
          ...process.env,
          FORCE_COLOR: '1',
        },
        program: '/Users/maxschmitt/Developer/playwright-vscode/test.js',
      });

in src/playwrightTestServer.ts is a minimal repro. We are forcing colors even tho the VSCode debugging session does not support colors.