Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Browser is not restarting when using runner class with junit suite parameters #3193

Open
mrpet88 opened this issue Jul 17, 2023 · 16 comments

Comments

@mrpet88
Copy link

mrpet88 commented Jul 17, 2023

Run sample project with clean test -Dcucumber.filter.tags="@MyTest"

When running with junit suite parameters:

@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("/features")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "io.cucumber.core.plugin.SerenityReporterParallel,pretty,json:build/test-results/cucumber/frontend/global/results.json,timeline:build/test-results/timeline")
public class CucumberTestSuite {}

And with serenity.conf values:

  restart.browser.for.each = scenario
  use.unique.browser = false

Then browser is not restarting.

Observe
that if tests run with the classic cucumber runner class (and with useJUnitPlatform() in gradle deactivated)

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
        plugin = {"pretty"},
        features = "src/test/resources/features"
)

Then browser is restarting as expected.

Repo to reproduce:
https://github.com/mrpet88/basicProjects/tree/main/src

Other info:
serenityCoreVersion = '3.6.x'

@wakaleo
Copy link
Member

wakaleo commented Jul 18, 2023

The sample project doesn't compile.

@wakaleo
Copy link
Member

wakaleo commented Jul 18, 2023

I'm not seeing this behaviour with 3.9.7 - could you check with that version?

@mrpet88
Copy link
Author

mrpet88 commented Jul 18, 2023

Yes 3.9.7 works, but I also found out that it was also happening because the two scenarios I was trying to run had exactly the same name (Searching for a term)
After upgrading the serenity core and changed the names it worked. But is 3.9.7 version a stable version that I could use ?

@wakaleo
Copy link
Member

wakaleo commented Jul 18, 2023

Yes, 3.9.7 is stable.

@mrpet88
Copy link
Author

mrpet88 commented Jul 20, 2023

@wakaleo since this is open. Is there a known issue with screenshots on failures and parallel execution? I have a reproducible example if you want I can give another example repo.

@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2023

I am not aware of such an issue

@mrpet88
Copy link
Author

mrpet88 commented Jul 20, 2023

On same repo -> https://github.com/mrpet88/serenity-cucumber-test-project

Running one scenario:
image

Running on parallel:
image

@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2023

I won't have time to look at this soon: could you take a look and raise a PR?

@mrpet88
Copy link
Author

mrpet88 commented Jul 20, 2023

I could try at least. Can you give me a small direction on where should I look for fixing?

@cliviu
Copy link
Collaborator

cliviu commented Jul 20, 2023

I can reproduce it, it looks like we have a bug, reported also here : #3176 . I will take a look

@cliviu
Copy link
Collaborator

cliviu commented Jul 21, 2023

@mrpet88 , I have pushed my changes here: https://github.com/cliviu/serenity-core/tree/screenshots_on_failures
Let my know please if you can try it.

@mrpet88
Copy link
Author

mrpet88 commented Jul 22, 2023

@cliviu is there a public snapshot version I could use? Or do I need to build the jar?

@cliviu
Copy link
Collaborator

cliviu commented Jul 22, 2023

Currently there is no publicversion

@mrpet88
Copy link
Author

mrpet88 commented Jul 22, 2023

Are there somewhere instuctions on how to use the branch as dependency? Not sure if I am missing something here but cant seem to be able to build the project

@cliviu
Copy link
Collaborator

cliviu commented Jul 22, 2023

No problem, just wait for the next release

@mrpet88
Copy link
Author

mrpet88 commented Sep 7, 2023

@cliviu should this work under new 4.0.1 version?

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

No branches or pull requests

3 participants