Providing drivers does not stop between tests in the protractor

there are two it () test compartments in the transporter

it('it1',function(){

});
it('it2',function(){

});

Does the driver terminate in the transporter after completing it 1?

Can we make a protractor so as not to get out of the car?

+4
source share
1 answer

Take this example and let Protractor run it for you:

describe('describe1', function () {
    it('it1', function () {
        browser.get('http://www.angularjs.org');
    });
    it('it2', function () {
        element(by.linkText('View on GitHub')).click();
        browser.sleep(3000); // Here you should se that you are now on GitHub
    });
});

You should notice that it2 works with the same driver. These two specifications are successful and cannot be such that if the browser goes between specifications. We could add a afterEach, where we do a browser.quit()to prove it. Result of adding afterEach:

: ( WebDriver.quit()?) .

, . . .

0

All Articles