serenity-bdd/serenity-cucumber-starter

Download prompt keeps being displayed

Opened this issue · 1 comments

Hello,

No matter what I try, when I run the starter project and click on the download page of the DuckDuckGo page the download prompt opens instead of downloading the file directly.
I've modified the serenity.conf of the starter project as follows

  • added the prefs part
  • added path to chromedriver
  • headless = false

I'm using chromedriver v.117 on chrome v.117.0.5938.14

serenity.conf

serenity {
    take.screenshots = FOR_FAILURES
}

headless.mode = false
webdriver {
  driver = chrome
  capabilities {
    browserName = "chrome"
    acceptInsecureCerts = true
    "goog:chromeOptions" {
      args = ["remote-allow-origins=*","test-type", "no-sandbox", "ignore-certificate-errors", "--window-size=1000,800",
        "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking",
        "disable-dev-shm-usage", "disable-extensions", "disable-web-security", "disable-translate", "disable-logging"]

      prefs {
        download.default_directory = "C:\\Users\\XXX\\Downloads\\"
        download.directory_upgrade = true
        download.prompt_for_download = false
        safebrowsing.enabled = false
        safebrowsing.disable_download_protection = true
        profile.default_content_settings.popups = 0
      }
    }
  }
}

drivers {
    windows {
        webdriver.chrome.driver = "src/test/resources/chromedriver.exe"
    }
}

The preferences appear in the console :

09:47:05.845 [ForkJoinPool-2-worker-7] INFO n.s.c.w.d.ChromeDriverProvider - Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [test-type, no-sandbox, ignore-certificate-errors, --window-size=1000,800, incognito, disable-infobars, disable-gpu, disable-default-apps, disable-popup-blocking, disable-dev-shm-usage, disable-extensions, disable-web-security, disable-translate, disable-logging, test-type, no-sandbox, ignore-certificate-errors, --window-size=1000,800, incognito, disable-infobars, disable-gpu, disable-default-apps, disable-popup-blocking, disable-dev-shm-usage, disable-extensions, disable-web-security, disable-translate, disable-logging, remote-allow-origins=*], extensions: [], prefs: {download.default_directory: C:\Users\XXX\Downloads, download.directory_upgrade: true, download.prompt_for_download: false, profile.default_content_settings.popups: 0, safebrowsing.disable_download_protection: true, safebrowsing.enabled: false}}}

What am I missing ?

Adding the args : "safebrowsing-disable-extension-blacklist", "safebrowsing-disable-download-protection"
and the pref : download.extensions_to_open = "appinstaller"
disables the prompt, but the file is opened, which is not what I expect...