You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently set out to write an end-to-end test using Playwright for a side project that I am working on. Part of the test involves selecting a file via the browser's native file dialog. The dialog can be opened by clicking on the React Dropzone component.
I tried to listen for the "filechooser" event via the instructions at https://playwright.dev/docs/input#upload-files, but Playwright was not detecting the "filechooser" event for some reason.
After doing some research, it appears that the event does not work with the File System Access API. I was able to get the "filechooser" event to fire by setting React Dropzone to disable the File System Access API:
useDropzone({useFsAccessApi: false})
I figured I would post this finding here in case someone else runs into the same problem in the future. 😀
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I recently set out to write an end-to-end test using Playwright for a side project that I am working on. Part of the test involves selecting a file via the browser's native file dialog. The dialog can be opened by clicking on the React Dropzone component.
I tried to listen for the "filechooser" event via the instructions at https://playwright.dev/docs/input#upload-files, but Playwright was not detecting the "filechooser" event for some reason.
After doing some research, it appears that the event does not work with the File System Access API. I was able to get the "filechooser" event to fire by setting React Dropzone to disable the File System Access API:
useDropzone({useFsAccessApi: false})
I figured I would post this finding here in case someone else runs into the same problem in the future. 😀
Beta Was this translation helpful? Give feedback.
All reactions