Skip to content

[Bug]: can't access process.stdout.clearLine in playwright test scope #29839

@HawtinZeng

Description

@HawtinZeng

Version

playWright/test@1.42.1

Steps to reproduce

Reproduce this bug is very hard.

Expected behavior

Can call process.stdout.clearLine in test scope.

test('command: build, build: true', async ({ page }) => {
  console.log('process.stdout.clearLine=', process.stdout.clearLine);
  const moduleWithTestMode = parseModule(`
  import { defineConfig } from 'vite';
  import vue from '@vitejs/plugin-vue';
  import stylelint from 'vite-plugin-stylelint';
  import inspect from 'vite-plugin-inspect';

  export default defineConfig({
    plugins: [vue(), stylelint({build: true}), inspect()],
  });`);
  await writeFile(moduleWithTestMode, './vite.config.ts');
  await startDefaultServe('build');
});

In terminal:

Running 1 test using 1 worker
[chromium] › main.spec.ts:91:1 › command: build, build: true
process.stdout.clearLine= undefined
  1 passed (1.5s)

Actual behavior

In terminal:

Running 1 test using 1 worker
[chromium] › main.spec.ts:91:1 › command: build, build: true
process.stdout.clearLine= [Function]
  1 passed (1.5s)

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
    Memory: 33.16 GB / 47.85 GB
  Binaries:
    Node: 20.11.1 - D:\APP\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD        
    npm: 10.2.4 - D:\APP\nodejs\npm.CMD
    pnpm: 8.10.2 - ~\AppData\Roaming\npm\pnpm.CMD
  IDEs:
    VSCode: 1.87.0 - D:\APP\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.42.1 => 1.42.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions