Error when trying `run-workers` with combination of `channel` using playwright helper.

Abierto
#4,609 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, node.js, playwright

Línea de trabajo

Comienza reproduciendo el problema en un proyecto de demostración de CodeceptJS usando el helper de Playwright, channel: 'msedge', y npx codeceptjs run-workers 2 en win32. Inspecciona la gestión del entorno del proceso hijo de run-workers y verifica que el navegador de channel se inicia correctamente durante la ejecución en paralelo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What are you trying to achieve?

When I use Playwright driver along with channel, and also use run-workers, I get error like the browser exe file is not present at specific location and browser cannot be launched.

How to reproduce?
  1. Create a demo codeceptjs project with playwright as driver.
  2. In codecept.conf.js file add the channel property inside playwright object (add any property from here) OR use below code.
const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure');
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();

/** @type {CodeceptJS.MainConfig} */
exports.config = {
  tests: './*_test.js',
  output: './output',
  helpers: {
    Playwright: {
      browser: 'chromium',
      url: 'http://localhost',
      show: true,
      channel: 'msedge',
    }
  },
  include: {
    I: './steps_file.js'
  },
  name: 'demo-codecept'
}
Command for execution

npx codeceptjs run-workers 2

Possible resolution way and reason for Error

The error comes when child processes are created for the parallel execution using run-workers. For windows operating system, the env variable are case-insensitive, which means process.env['PROGRAMFILES(X86)'] and process.env['ProgramFiles(x86)'] would produce same output. But inside the child process, only writing exact case only produces result. ex. process.env['ProgramFiles(x86)'] will produce correct output and anything other produces undefined.
Because of this it is not able to find the correct path at which the browser exe files are present.

Details
  • CodeceptJS version: 3.6.6
  • NodeJS Version: 22.11.0
  • Operating System: win32
  • playwright: 1.49.0
Lenguaje dominante
JavaScript
Estrellas
4.2k
Forks
756
Merge medio
2 d 9 h
PR fusionados (30 d)
16

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codeceptjs/CodeceptJS

Todos los issues de codeceptjs/CodeceptJS

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.