Is it possible to restart the browser between specifications in integration tests?

We have a Protractor / Jasmine number or qualifier for our AngularJS based project. This is ok to do:

afterAll(function(){
   browser.restart();
}

to clear things between specs?

+4
source share
1 answer

There is a built-in setting - restartBrowserBetweenTests:

// If true, protractor will restart the browser between each test.
// CAUTION: This will cause your tests to slow down drastically.
restartBrowserBetweenTests: false,

As the comment says - this slows down your tests - make sure that there is a real reason for restarting the browser between tests. Please note that installation means restarting the browser with each it(), and not describe().

, restart() , - browser, element, $ ..

/ - , cookie /. , , ( , ).


( , promises), . , , .

, , , . , browser - browser.


, / :

multiCapabilities: [
    {
        browserName: "chrome",
        chromeOptions: {
            args: ["incognito", "disable-extensions"]
        },
     }
],
+1

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


All Articles