file icon indicating copy to clipboard operation
file copied to clipboard

Impossible to run selenium tests on `elm/file`

Open francescortiz opened this issue 5 years ago • 3 comments
trafficstars

Selenium tests needs access to the html input but elm/file never places its input element in the dom.

What approach do you use/suggest?

Thanks in advance.

francescortiz avatar Apr 17 '20 13:04 francescortiz

I just found that I can trick the window manager with auxiliary OS tools, but I wonder if there is a workaround you know of.

francescortiz avatar Apr 17 '20 13:04 francescortiz

With headless selenium the OS tools don't have any effect, so I came out with a hack to do it:

https://discourse.elm-lang.org/t/showcasing-how-to-do-tests-for-elm-file-with-selenium/5574

But I think that a cleaner fix would still be needed.

francescortiz avatar Apr 17 '20 19:04 francescortiz

This is causing me problems as well, and the above fix is too hacky for me.

What would be ideal tbh is if the file input element was appended invisibly to the document body and then removed again at the end of the change callback here but I can see that may not be viable.

JonnieCache avatar Jun 28 '22 14:06 JonnieCache