Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
¿Cargar varios archivos json en un solo traje de prueba es una buena práctica en Cypress?

¿Cargar varios archivos json en un solo traje de prueba es una buena práctica en Cypress? Algo como esto:

 before(() => { cy.fixture('productCatalogData').then((datajson) => { recipeData = datajson.recipes; return recipeData; }); cy.fixture('loginData').then((datajson) => { loginData = datajson; return loginData; }); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si necesita ambos archivos json en una suite, no creo que deba haber problemas para usar accesorios varias veces. Sin embargo, puede acortar el código cy.fixture() un poco así :

 before(() => { cy.fixture('productCatalogData').as('productCatalogData') cy.fixture('loginData').as('loginData') }) it('Access fixtures data', function () { // The test has to use "function" callback to make sure "this" points at the Mocha context //Access fixtures data using this.productCatalogData and this.loginData })

Pero una cosa para agregar aquí, Cypress elimina los alias después de cada prueba. Entonces, si solo tiene una prueba dentro de la suite, before() funcionará bien, pero si tiene varias pruebas, debe usar beforeEach() .

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!