javascript - Protractor: cleanup after test suite is finished -


in "conf.js" test suites arranged follows(using saucelab's webdriver):

suites: {     abc: './abc/spec.js',     xyz: './xyz/spec.js',     pqr: './pqr/spec.js' }, 

the problem above arrangement if 1 of alert box/window unexpectedly appears in 1 of test suite,test suites after particular suite suffer , start failing.

is there in-built way in protractor close windows/alert box etc. when test suite finished or can handled manually?

from understand, there no place in protractor provide "before test suite" or "after test suite" logic (correct me if i'm wrong it).

the idea use aftereach(), try switching alert, dismiss() if exists (or accept() depending on need), nothing if not exist:

describe("my test", function () {     aftereach(function () {         browser.switchto().alert().then(             function (alert) {                  alert.dismiss();              },             function (err) {}         );     });      it("test smth", function () {         // ...     }); }); 

see also:


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -