Reputation: 11
Using testcfae We are trying to export a .csv file in chrome and save it in our automation package folder (Automation/UI/Downloads) itself. But we not able to set the custom download path in testcafe. Currently, we are using default download path (user/downloads) to save the files in our local mac machine. We are using the following code for now.
await this.clickElem (common.exportbutton); // click export button
await this.waitFor (userVariables.dataLoadTime); // wait to download
// downloadLocation - system downloads path (user/downloads)
await t.expect(fs.existsSync(downloadLocation + expectedfilename)).ok();// assertion to verify file is exported
Please let me know how to set the custom download path in testcafe. So that the file exported should get stored in the specified folder under the automation package.
Upvotes: 0
Views: 22