Closed
Description
Current behavior
Using cy.task() as in the example, but am getting the error message:
"CypressError: cy.task()
must only be invoked from the spec file or support file."
Am having the same issue as reported here.
Desired behavior
It should work as it is described in the documentation
Test code to reproduce
In cypress.config I have added:
e2e: {
setupNodeEvents(on, config) {
on('task', {
log(message) {
console.log(message);
return null;
},
});
}
}
and in the test just call the cy.task()
Cypress Version
13.3.0
Node version
18.13.0
Operating System
Ubuntu 23.04
Debug Logs
No response
Other
No response
Metadata
Metadata
Assignees
Labels
No labels