Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

300
Vistas
How to fix "Error: ENOENT: no such file or directory - cypress plugins in jenkins"

Cypress Testing --> I added below code to plugins/index.js , locally the test runs fine but when run on jenkins I get an error

function getConfigurationByFile(file) {
  const pathToConfigFile = path.resolve(
    '..',
    'automation/cypress/configFiles',
    `${file}.json`
  );

  return fs.readJson(pathToConfigFile);
}

module.exports = (on, config) => {
  const file = config.env.fileConfig || 'qat';

  return getConfigurationByFile(file);
};

error in jenkins -->

The function exported by the plugins file threw an error. We invoked the function exported by /var/lib/jenkins/jenkins-agent/workspace/ui-automation/cypress/plugins/index.js, but it threw an error.

Error: ENOENT: no such file or directory, open '/var/lib/jenkins/jenkins-agent/workspace/automation/cypress/configFiles/qat.json'

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I was able to fix this issue. The workspace path wasn't correct in my code.

jenkins workspace : workspace/ui-automation/cypress/

local workspace : workspace/automation/cypress

updated code :

  const pathToConfigFile = path.resolve(
    '..',
    'ui-automation/cypress/configFiles',
    `${file}.json`
  );

  return fs.readJson(pathToConfigFile);
}

module.exports = (on, config) => {
  const file = config.env.fileConfig || 'qat';

  return getConfigurationByFile(file);
};
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda