0

Configuration:

 capabilities: {
        'browserName': 'chrome',
        'chromeOptions': {

            prefs: {
                download: {
                    'prompt_for_download': false,
                    'directory_upgrade': true,
                    'default_directory':  'src/test/javascript/e2e/downloads'
                }
            }
        }
    },

I download with this

productDashboardPageObject.exportDashboard();

It downloads but I cant check if it was downloaded.

How to check if files has been downloaded ?

jordiburgos
  • 5,964
  • 4
  • 46
  • 80
mark
  • 727
  • 3
  • 14
  • 35
  • 1
    You can add a wait for the file existence similar to this: http://stackoverflow.com/a/27031924/771848. – alecxe Nov 28 '16 at 14:40
  • but there they give specific file name var filename = '/tmp/export.csv'; . mine is random – mark Nov 28 '16 at 15:16
  • 2
    Well, you can use the directory watcher like [this one](https://nodejs.org/docs/latest/api/fs.html#fs_class_fs_fswatcher). – alecxe Nov 28 '16 at 16:30
  • sorry, i couldnot see. can you give an example as an answer please @alecxe – mark Nov 29 '16 at 12:40

0 Answers0