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

109
Vistas
How to use two different json data files as per environment in cypress

I have a specific requirement to use two different data files per environment (stage.json & prod.json) in such a way that when I use stage env, data should come from stage.json & when I use prod env, data should come from prod.json. I have created a framework in Cypress using Mocha. I checked tutorials of Cypress but could not find relevant information. I also googled out but no luck. I would appreciate any help here.

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

0

What about using plain JS :

if (process.env.NODE_ENV === 'development') {
// do dev stuff
} 
if (process.env.NODE_ENV === 'production') {
//do production stuff
}

I guess you could find a trick, based on this logic, to differenciate staging from prod. I don't think that Cypress itself could handle that.

I hope this could help

about 4 years ago · Juan Pablo Isaza Denunciar

0

Take a look at Configuration

Change Configuration File

You can change the configuration file or turn off the use of a configuration file by using the --config-file flag.

cypress open --config-file <config-file>

So, have your staging in cypress.json then to run prod call cypress run --config-file prod.json.

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