Cypress · Junior · Question 53 of 75
What does cy.task() do?
- 1Schedules a test to run at a later time
- 2Runs code in the Node process, e.g. to seed a database
- 3Creates a task in the team's issue tracker system
Show the answer
Correct answer: Runs code in the Node process, e.g. to seed a database
Explanation
Tasks are registered in setupNodeEvents and can do things the browser can't, like file system or database access.