I just tried it in a clean repository and it works...
# help
a
I just tried it in a clean [repository](https://github.com/sweidac/cypress-selectFile) and it works there. Unfortunately I can't share my original code, so I'll have to find it out for myself.
Ok, I just discovered that
Cypress.version
returns
'9.1.0'
when run in the console during a test. The settings tab in the cypress window says im on
9.4.1
as well as
./node_modules/cypress/bin/cypress --version
a
You may need to clear the cypress cache, then do a fresh install. You can find more in the docs here: https://docs.cypress.io/guides/references/troubleshooting#Clear-Cypress-cache
I have to run
npx cypress cache clear
a
Unfortunately that didn't help. I'm now trying to run the test on a machine that has never heard of cypress to check whether it's something in my repo.
I think I fixed it: The testrunners storage (Chromium 97) needed to be reset' manually. Then
Cypress.version
yields the correct value and
selectFile()
is available where I expected it.
Just in case u wonder how to reset: 1. Open Devtools 2. Open "Application" tab 3. Click on the side-navigation, click on "Storage" 4. Click on "Clear site data" 5. Reload the site
On Firefox, you need to 1. Open Settings 2. Open "Privacy & Security" 3. Click "Clear Data" 4. Clear all 5. Restart Browser
a
This is really great to know! Can you confirm if you needed to do this in the Cypress App or if this was done in your actual browser?
a
Sorry for not responding. This needs to be done in the browser that executes each test, __NOT__ the Cypress app.
a
No worries at all! Thanks so much for confirming!
3 Views