Cypress · Middle · Question 28 of 77

How do you read a downloaded file in a Cypress test?

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.

Further reading

Problem with a question

Cypress · Middle · question 28

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz