Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

5.1.0 breaks backwards compatibility with custom frameworks (calling afterEach is now required) #4087

Open
jan-molak opened this issue Feb 11, 2017 · 5 comments

Comments

@jan-molak
Copy link
Contributor

jan-molak commented Feb 11, 2017

Hi @sjelin!

It seems like as of this commit custom frameworks have to call runner.afterEach after every test, even though the documentation states that this will be a requirement starting from Protractor 6.0.0.

We're adding support for this behaviour to Serenity/JS now to allow people to use Protractor 5.1.x, but I suppose the docs should be updated to clearly state that this is now a requirement?


To reproduce the problem, please install a custom framework, such as protractor-cucumber-framework and try to run several test scenarios with restartBrowserBetweenTests set to true.

The browser does not get restarted.

Calling runner.afterEach() after every test solves the issue.

(I see that you've requested support for this in protractor-cucumber-framework/protractor-cucumber-framework#67 by the way).

Best,
Jan

@jan-molak jan-molak changed the title 5.1.1 breaks backwards compatibility with custom frameworks (afterEach is **required**) 5.1.0 breaks backwards compatibility with custom frameworks (calling afterEach is now required) Feb 11, 2017
jan-molak added a commit to serenity-js/serenity-js that referenced this issue Feb 11, 2017
This change adds support for using Serenity/JS with Protractor 5.0.0, 5.1.0 and 5.1.1:
- `ProtractorNotifier` deals with Protractor 5.1.0 requirement for test frameworks to invoke `runner.afterEach` after every test,
so that the browser is correctly restarted between the tests. See angular/protractor#4087
- `TestFrameworkDetector` registers `mochaOpts` and `cucumberOpts` as valid command line options,
benefiting from angular/protractor#3994 and dealing with a bug introduced in Protractor 5.0.0, which prevents command line arguments
from being passed on to custom test frameworks. See angular/protractor#3978
- Updated the examples and documentation to work with Protractor 5.1.x
- Enables #18

Related issues: angular/protractor#3978 angular/protractor#3994 angular/protractor#4087 #18
@sjelin
Copy link
Contributor

sjelin commented Feb 13, 2017

The plan is for it to only be a requirement in 6.0. I am very surprised that 5.1 causes problems.

@sjelin
Copy link
Contributor

sjelin commented Feb 13, 2017

Question: The same tests works in 5.0.0? And, in the tests you mentioned, is the control flow disabled?

@sjelin
Copy link
Contributor

sjelin commented Feb 13, 2017

Actually, the only question is if the control flow is disabled. I could see how that change could be a problem if the control flow was disabled.

@jan-molak
Copy link
Contributor Author

jan-molak commented Feb 14, 2017

I tested the same scenario switching between 5.1.1 and 5.0.0, and yes, the same test works with 5.0.0; in both cases:

  • the control flow is enabled (default settings).
  • the browser is restarted between the tests

However, this only happens with custom frameworks that don't invoke the afterEach hook - such as protractor-cucumber-framework. The built-in ones are fine, and so is Serenity/JS now.

Please let me know if I can be of more help.

@sjelin
Copy link
Contributor

sjelin commented Feb 14, 2017

This is very surprising. The behavior shouldn't have changed when the control flow is enabled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants