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

187
Views
Test file re-running in Cypress framework

I have several feature files in a Cypress test framework.

Here is the final step in Test File 2:

Then('I store that Order ID in a JSON file', () => {
    cy.get('.dx-font-l').then(orderId => {
        cy.writeFile("cypress/fixtures/purchase.json", {
            orderId: orderId.text()
        });
    })
});

And here is the first step definition in Test File 3 (the next feature file executed):

Given('I navigate to the store website', () => {
    cy.visit(Cypress.env('storeUrl'));
});

As-is:

  • When Test File 2 above completes, Test File 3 begins to load, but then another test file that I ran at the beginning is re-run rather than Test File 3.

If, I remove the below code from Test File 2, all 3 files pass as expected.

cy.get('.dx-font-l').then(orderId => {
    cy.writeFile("cypress/fixtures/purchase.json", {
        orderId: orderId.text()
    });
})

Can someone please tell me why this block of code is causing this behavior? I expect that it shouldn't.

about 4 years ago · Juan Pablo Isaza
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!