Skip to content

"must only be invoked from the spec file or support file." errors using cy.selectFile() & cy.readFile() #27457

Description

@S-Lomax

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions