Skip to content

Instantly share code, notes, and snippets.

@henrywang
Created May 16, 2019 06:37
Show Gist options
  • Save henrywang/68543cc993f71826907c3f2128a8cd94 to your computer and use it in GitHub Desktop.
Save henrywang/68543cc993f71826907c3f2128a8cd94 to your computer and use it in GitHub Desktop.
wdio.conf.js
// Store the directory path in a global, which allows us to access this path inside our tests
const downloadDir = "/e2e/uploads/";
capabilities: [
{
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
// grid with only 5 firefox instances available you can make sure that not more than
// 5 instances get started at a time.
maxInstances: 1,
//
browserName: process.env.BROWSER || "firefox"
// disable prompt for download dialog
// chromeOptions: {
// prefs: {
// "download.default_directory": downloadDir,
// "download.prompt_for_download": false,
// "download.directory_upgrade": true
// }
// }
}
],
services: ["firefox-profile"],
firefoxProfile: {
"browser.download.dir": downloadDir,
"browser.download.folderList": 2,
"browser.helperApps.neverAsk.saveToDisk": "application/x-tar"
},
ViewBlueprint.page.js
get imageDownloadButton() {
const selector = "span=Download";
browser.waitUntil(
() => browser.isExisting(selector),
timeout,
`Download button in View Blueprint page cannot be found by selector ${selector}`
);
return $(selector);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment