I'm testing a file upload feature and trying to upload remote files(e.g. https://s3.amazonaws.com/some_dir/some_file). Using type() throws an error stating the path is not absolute. Is this supported by intern? If yes, how should it be done?
Leadfoot handles file uploads like this:
type
on a file input element with the local (to Intern) path of a file. This file must exist on the system running Intern. You can get an absolute path to it by using require.toUrl
(e.g., element.type(require.toUrl('./someFile.txt'))
).sendKeys
on the input element using the path of the newly uploaded file on the remote server.The end goal is for the remote browser to be able to select a file for a file input and send it somewhere. For that to work, the file must exist on the remote system (the one running the browser being tested).