Chromatograph preference setup on protractor tests

Trying to find a solution for downloading files during my tests, I found this question which will lead me to the settings file in the chrome folder.

There seems to be no information on closing the invitation to download and / or set the default folder. Does anyone know how I can do this?

Here is what I tried:

capabilities: { 'browserName': 'chrome', 'chromeOptions': { prefs: { 'downloads': { 'prompt_for_download': false, 'default_directory': '/downloads/' } } } }, 
+5
source share
2 answers

You are doing it right, except for what you need:

  • specify the absolute path to the "downloads" directory
  • add directory_upgrade option

Example:

 capabilities: { 'browserName': 'chrome', 'chromeOptions': { prefs: { download: { 'prompt_for_download': false, 'directory_upgrade': true, 'default_directory': '/absolute/path/here' } } } }, 

See also: Unable to stop transportation from showing file download

+9
source

Lukasz K 'rock answer !! β†’ 'default_directory': process.cwd () + '/ lative / path /'

0
source

Source: https://habr.com/ru/post/1210982/


All Articles