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);
});
});
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()?) .
, . . .