Not sure. Maybe firefox behaves like that for security reasons.
While on Chrome and Chrome headless 68.0.3440 the file is downloaded without any native dialog, on firefox a dialog appears and prompts for user input.
This is not a blocker since the test does not fail after that. But if you want to assert the download, test will fail because file is not automatically downloaded.
...
const downloadAssetLogger = RequestLogger(/download\/asset.php/, {
logResponseBody: true,
logResponseHeaders: true
});
...
// ==================
// Test custom assets - file
// ===================
await t
.click(page.microsite.assets.custom.file)
.expect(downloadAssetLogger.contains(record => record.response.statusCode === 302)).ok()
.expect(downloadAssetLogger.requests[0].response.headers.location).contains('.zip');
On tests, no native dialogs should pop up when an action is downloading a file.
Create a test like the example above and run it on a windows 10 machine with Firefox 61.0.0 or Firefox 61.0.2.
Can this native dialog handled by the setNativeDialogHandler? Thank you.
+1
We tried to update firefox profile and disable alert appearing right before tests execution. It was working for some time, but i assume after FF updating this problem started to reproduce again.
It seems the same happens for ie11

@AndreyBelym is there a way to force the download in firefox, e.g. automatically accepting the dialog?
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.
Most helpful comment
@AndreyBelym is there a way to force the download in firefox, e.g. automatically accepting the dialog?