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

feat: cy.selectFile() (#19332) #19524

Merged
merged 4 commits into from Jan 14, 2022
Merged

feat: cy.selectFile() (#19332) #19524

merged 4 commits into from Jan 14, 2022

Conversation

BlueWinds
Copy link
Contributor

@BlueWinds BlueWinds commented Jan 3, 2022

User facing changelog

Adds Cypress.Buffer, exposing the Buffer polyfill for working with binary data.

Adds native support for .selectFile(), allowing interaction with file input elements as well as simulating a user drag-dropping files over the document.

cy.get('input[type="file"]').selectFile('cypress/fixtures/myfixture.json');

The API is similar to cypress-file-upload, and we have provided a migration guide for previous users of that plugin.

For full details, see the .selectFile() documentation.

Additional details

The documentation and migration guide contain extensive information about all the options and features of this new command.

PR Tasks

* feat: cy.attachFile with passed-in contents (#18825)
* feat: attachFile string shorthands (#19045)
* feat: Add drag-n-drop support (#19213)
* Remove cypress-file-upload
@BlueWinds BlueWinds requested a review from a team as a code owner January 3, 2022 18:12
@BlueWinds BlueWinds requested review from jennifer-shehane and removed request for a team January 3, 2022 18:12
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 3, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jan 3, 2022



Test summary

19129 0 218 0Flakiness 1


Run details

Project cypress
Status Passed
Commit 5f74fe0
Started Jan 11, 2022 7:49 PM
Ended Jan 11, 2022 8:00 PM
Duration 11:28 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

AtofStryker
AtofStryker previously approved these changes Jan 4, 2022
@jennifer-shehane jennifer-shehane removed their request for review January 5, 2022 16:26
@BlueWinds
Copy link
Contributor Author

BlueWinds commented Jan 10, 2022

@cowboy - Added Cypress.Buffer to this branch rather than its own PR, because it was a small change and it also didn't make sense to do separately (I would still have to update this PR as well, to use it in the tests / type docs).

cypress-services PR to add on.cypress link to new docs page: https://github.com/cypress-io/cypress-services/pull/4195

Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BlueWinds looks like theres an issue adding the type BufferModule = import("buffer/") to the declaration file. Is that right?

@BlueWinds
Copy link
Contributor Author

@BlueWinds looks like theres an issue adding the type BufferModule = import("buffer/") to the declaration file. Is that right?

Ah, I thought I'd fixed that. Pushed a new change that should address it for real this time.

@AtofStryker AtofStryker self-requested a review January 11, 2022 22:12
@tnrich
Copy link
Contributor

tnrich commented Jan 18, 2022

A heads up that the changelog link to the blog about the new functionality is broken:

https://cypress.io/blog/2022/01/18/uploading-files-with-selectfile/

image

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 18, 2022

Released in 9.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 18, 2022
@BlueWinds
Copy link
Contributor Author

We released the code late in the evening and didn't publish the blog post until the following day. Fixed now, thanks for the report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Ability to Submit File to Input Element From Local Filesystem (file upload)
5 participants