Cypress · Middle · Question 28 of 77
How do you read a downloaded file in a Cypress test?
- 1
cy.download('report.csv').text() - 2
cy.readFile('cypress/downloads/report.csv') - 3Files can't be read from Cypress tests
Show the answer
Correct answer: cy.readFile('cypress/downloads/report.csv')
Explanation
Downloads go to the configured downloadsFolder. cy.readFile retries until the file exists, then you assert on its content.