node.js - Selenium Node + Sauce Labs Testing: Cannot Finish a Task -


i'm using sauce labs run selenium test scripts mocha testing framework. scripts ran perfectly, problem is, job not finish - seems driver.quit() ignored, , i'm prompted timeout error after 90 secs.

here's code:

const { driver } = require('./config'); const { by, until } = require('selenium-webdriver');  describe('integration test', function () {   this.timeout(20000);    it('can login test user', function () {     driver.get('https://www.example.com');     driver.wait(until.elementisnotvisible(driver.findelement(by.id('vale'))), 8000, 'vale cannot fade');     driver.findelement(by.name('email')).sendkeys('test_user@test.com');     driver.findelement(by.name('password')).sendkeys('password');     return driver.findelement(by.id('authformsubmitbutton')).click();   });    after(() => {     console.log('quiting driver');     // not work!     driver.quit();   }); }); 

in config driver built , connected remote server.

when running this, in console can see test passing , quiting driver message, in sauce labs dashboard task keeps waiting until time out.

btw tested above code local chromdriver , works fine - driver quitted after task.

any or idea appreciated.

needs return before driver.quit().

instead of calling done(), mocha accepts promise return value. if test returns promise, mocha understands it’s asynchronous, , waits promise resolved before passing next test.

this article valuable.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -