lundi 24 avril 2017

Check in nightmare.js if dialog was opened by electron

start In my app I try to test if file download works properly. Test has to sign in user and download file. Everything looks good when I watch the test - dialog for saving file opens but how can I check it in Nightmare?

Here is my code:

it('should download file', function (done) {
      new Nightmare({show: true, waitTimeout: 60000, typeInterval: 10})
        .goto(url)
        .type('input[name="email"]', `test@com.com`)
        .type('input[name="password"]','test')
        .click('.btn-lightblue')
        .wait('.topbar-list')
        .goto(`${url}/test`)
        .wait(5000)
        .click('.file button') //click start downloading file and show dialog for saving the file
        // here I would like to check if dialog is opened or not //
        .end()
        .then(function(){
          done()
        })
        .catch(function (error) {
          console.error('Search failed:', error);
          done()
        })        
    })

Aucun commentaire:

Enregistrer un commentaire