-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Calling Runner::afterEach() should not start a new browser after the last test in the suite #4315
Comments
I managed to reproduce this issue using the built-in Jasmine framework and running the example_spec.js from the Protractor repo, so the problem is not limited to custom frameworks. Even though the example_spec.js only contains 3 tests, 4 browsers are spawned. I've added a
Please let me know if there's anything else I can do to help? |
This is giving us some trouble, too. Our setup consists of Protractor 5.3.1, jasmine 2.8.0, paired with Sauce Labs. We can't set Furthermore, the new/last browser session's ID is then used in Sauce Lab's Tangentially, we have mitigated some of this behavior by creating a custom Sauce Labs reporter for jasmine, which obtains the browser ID in |
Hi there!
As of Protractor 5.1.0 (#4087) custom frameworks, such as Serenity/JS, have to invoke
runner.afterEach()
after every test so that Protractor can restart the browser should the developer set therestartBrowserBetweenTests
flag totrue
.However, when
runner.afterEach()
is invoked after the last test in the suite, Protractor will again restart the browser only to then immediately shut it down.This behaviour seems incorrect, and it seems to me like it could be resolved by either:
afterEach
method only ever invokes the restart if the test is not the last one in the suiteafterEach
is doing is restarting the browser:afterEach
tobeforeEach
and require the custom frameworks to invoke that method before a test starts. This would also resolve restartBrowserBetweenTests should restart test in beforeEach, not afterEach #4224Thoughts?
Jan
The text was updated successfully, but these errors were encountered: