Closed Tacoholic closed 2 years ago
I used attachFile
in a few of my tests and didn't have any problems with that. attachFile
is not synchronous - it does not wait until file is uploaded. Second thing - cy.contains("File Successfully Uploaded!")
probably look through your whole DOM, so how do you show that text? Is this just hidden before upload, or it is added to DOM when file is uploaded?
Could you also paste code which you use to upload?
@tomaszczura It turns out that the input was well hidden in the Dom. It was in the app-root
, inside a selector called app-file-selector.
Test is working and passing.
@all-contributors add @tomaszczura for question
Thanks for helping out here, really appreciate that!
@abramenal
I've put up a pull request to add @tomaszczura! :tada:
Current behavior:
So I am currently trying to create a test where I can upload a file from my computer. When I run the test, it tells me it passed, but when I check the browser to look at the way the test was executed, the file did not upload. So I then added an assertion that confirms that the message "File Successfully Uploaded!" will display when a file is uploaded. It is not failing. I followed the documentation, step-by-step, but no luck. Not sure why the test is saying that the file was uploaded, when it's not true.
This is telling me the test passed. https://share.getcloudapp.com/Jruny1Rp This is when I looked at the browser. There should be a message saying "file uploaded successfully". https://share.getcloudapp.com/Jruny4ll
Desired behavior:
Steps to reproduce: (app code and test code)
Spec file. My png image is in the fixtures folder.
The HTML for it:
Versions
Cypress version: 8.0.0 Browser: Electron 89