Skip to content

Resurfacing of command 'must only be invoked from the spec file or support file.' #27149

Description

@RobHannay

Current behavior

  • Running selectFile with action: 'drag-drop' throws Error: CypressError: cy.selectFile() must only be invoked from the spec file or support file.

Desired behavior

Fixture would be 'dropped' on the file input without erroring

Test code to reproduce

https://github.com/RobHannay/cypress-test-tiny

  cy.get('input[type=file]')
    .first()
    .selectFile('cypress/fixtures/videos/Koala1.mp4', { force: true }, { action: 'drag-drop' });

Cypress Version

12.16.0

Node version

18.16

Operating System

macOS 13.4.1

Debug Logs

(Has some possibly sensitive info on our corporate codebase; can make available privately)

Other

Continuation of #27099.

Activity

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

Metadata

Metadata

Assignees

Labels

E2EIssue related to end-to-end testingTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.type: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions