Testcafe: Download file native dialog @ firefox

Created on 16 Aug 2018  路  4Comments  路  Source: DevExpress/testcafe

Are you requesting a feature or reporting a bug?

Not sure. Maybe firefox behaves like that for security reasons.

What is the current behavior?

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');

What is the expected behavior?

On tests, no native dialogs should pop up when an action is downloading a file.

How would you reproduce the current behavior (if this is a bug)?

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.

Specify your

  • operating system: Windows 10
  • testcafe version: 0.21.1
  • node.js version: 9.3.0

Question

Can this native dialog handled by the setNativeDialogHandler? Thank you.

client level 2 Auto-locked automations bug

Most helpful comment

@AndreyBelym is there a way to force the download in firefox, e.g. automatically accepting the dialog?

All 4 comments

+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
image

@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.

Was this page helpful?
0 / 5 - 0 ratings