-
Notifications
You must be signed in to change notification settings - Fork 277
File upload fails to upload file #389
Comments
Which Mink driver are you using ? The behavior of triggering a page refresh on file upload is something I never saw and that I never heard of until now. Could it be something triggered by some JS code on the page ? |
Goutte I assume. From the behat config file:
I don't know whether it's a real refresh, the effect was that when I uploaded a file with the step in the original message, it would throw away all values in the form previously entered with other behat steps. Hence the workaround. But since the last ddev upgrade even the workaround fails. A colleague has the same with my database dump, the same git version, and a little older ddev version. The behats worked right before the ddev upgrade, it stopped working right after. Same codebase, same database state. The only thing I can think of now is that the ddev update comes with a new apache version. |
The package you use seems to be a different extension. This package is not defining |
It's this one... The function I use is on line 207 of https://github.com/Behat/MinkExtension/blob/master/src/Behat/MinkExtension/Context/MinkContext.php. What it looks like is that when using this function in Drupal 10, the whole form is cleared somehow. I was running a set of behat tests that were green on Drupal 9, I only did the Drupal 10 upgrade, and afterwards the behats using this function fail since the file to be attached is not really attached. |
Anyone already found a solution for the upload failing? It did work on Drupal 9, it started failing on Drupal 10. |
Uploading a file with 'When I attach the file "pdf-sample.pdf" to "edit-field-document-0-upload"' doesn't work anymore.
I'm using Drupal 9/10, I had behats which were all green (some of them were uploading files). The only thing I changed was upgrading our ddev development environment to the latest version, so I assume the apache version in use inside of ddev is now newer than before.
The code of the step being used in behat is this (from mink-extension, hence the issue here):
Before we had problems with this step which we worked around:
What we saw before is that when a file is uploaded a refresh of the page would be done, so anything filled in on a form before the upload of a file would disappear. The workaround in behat was then:
Since the ddev upgrade, this workaround is also not working anymore. I (x)debugged the step, but I don't see anything strange happening that could explain the behavior.
The text was updated successfully, but these errors were encountered: