Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining .selectFile from document throws an error #29593

Open
georgekaran opened this issue May 29, 2024 · 1 comment
Open

Chaining .selectFile from document throws an error #29593

georgekaran opened this issue May 29, 2024 · 1 comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: unexpected behavior User expected result, but got another

Comments

@georgekaran
Copy link

Current behavior

When attempting to use the following commad:

cy.document().selectFile('example.json', {action: 'drag-drop'});

I get the following error:

CypressError: `cy.selectFile()` failed because it requires a DOM element.

The subject received was:

  > `<document>`

The previous command that ran was:

  > `cy.document()`

Desired behavior

It should allow drop files in the document as described in the docs

Test code to reproduce

I made a repo with the issue: https://github.com/georgekaran/cypress-test-tiny/tree/document-select-file

Cypress Version

v12.17.4

Node version

v20.10.0

Operating System

macOS 14.5

Debug Logs

No response

Other

No response

@cacieprins cacieprins added the stage: needs investigating Someone from Cypress needs to look at this label May 29, 2024
@jennifer-shehane jennifer-shehane added the type: unexpected behavior User expected result, but got another label Jun 3, 2024
@jennifer-shehane
Copy link
Member

Yah I'm unsure if the documentation is incorrect or if we changed the behavior unintenionally somewhere to make this fail. It makes sense to me that you'd target a document to drag and drop though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

3 participants