cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.08k stars 3.19k forks source link

The `.selectFile` command does not work from an aliased fixture #19803

Closed wlsf82 closed 2 years ago

wlsf82 commented 2 years ago

Current behavior

The file is not selected when using an aliased fixture, as follows on the docs of the new .selectFile command (on the From a fixture section.)

Desired behavior

The file should correctly be selected from an aliased fixture.

Test code to reproduce

https://github.com/wlsf82/cy-hands-on-select-file/blob/main/cypress/integration/selectFile.spec.js#L21

Note: To test it out, change the test from .skip() to .only().

Cypress Version

9.3.1

Other

Here is a screenshot of the failure.

cy handsOn( selectFile) -- selects a file for upload using an aliased fixture (failed)

BlueWinds commented 2 years ago

The current implementation stores the fixture file contents, but does not persist the file name when you alias it - which your test is asserting on.

This isn't a great experience, and we'll be resolving it in 9.4.0 - the fixture filename will be preserved through an alias. I'll have a PR up in a few minutes here.

cypress-bot[bot] commented 2 years ago

The code for this is done in cypress-io/cypress#19820, but has yet to be released. We'll update this issue and reference the changelog when it's released.

cypress-bot[bot] commented 2 years ago

Released in 9.4.0.

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