cypress: "must only be invoked from the spec file or support file." errors using cy.selectFile() & cy.readFile()
Current behavior
Recently updated to Cypress 12.17.3 from 12.14 and are still getting “must only be invoked from the spec file or support file.” errors when using commands cy.selectFile(), cy.readFile() and cy.task().
Exactly the same behaviour as https://github.com/cypress-io/cypress/issues/27149
Desired behavior
No response
Test code to reproduce
cy.get('[data-cy="QA_Automation_Section_Zip-accordion-button"]').click()
cy.get('[data-cy="thumbnail-button-QA_Automation_Slide_Zip"]').click()
cy.get('[data-cy="upload-container"]').selectFile('cypress/fixtures/QA_Automation_Slide_Deploy.png', {force: true})
Cypress Version
12.17.3
Node version
18.16.1
Operating System
Windows 10.0.19045.3208
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 18 (5 by maintainers)
Hi everyone, i’m still experiencing the same issue too. It was working on cypress 12.14.0 but since not.
Cypress Version
12.17.3
Test code to reproduce:
Current behavior
HI @nagash77 I have the same problem as mentioned above. We updated our cypress from 10 to the newest version and for some reason, this line just stopped working:
I’m getting the same error: must only be invoked from the spec file or support file