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

'serenity.restart.browser.for.each=feature' don't work when ran using the JUnit Platform Suite Engine #141

Open
gorakshasabnis opened this issue Mar 21, 2024 · 2 comments

Comments

@gorakshasabnis
Copy link

What happened?

  1. Create more that 1 feature files having 2 or more scenarios per feature file.

  2. Create cucumber runner as below:

@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("/features")
@ConfigurationParameter(key = EXECUTION_MODE_FEATURE_PROPERTY_NAME, value = "SAME_THREAD")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME,
        value = "io.cucumber.core.plugin.SerenityReporterParallel," +
                "pretty,timeline:target/test-results/timeline")
public class JUnitPlatformSuiteEngineRunner {
}
  1. Add serenity.properties file with below details:
serenity.requirement.types=capability, feature
serenity.project.name=ToDo MVC Automation Report
serenity.restart.browser.for.each=feature
serenity.browser.maximized=true

Actual Result: Running test suite opens new browser for every new scenario irrespective of same or new feature file.

What did you expect to happen?

Expected Result: serenity.restart.browser.for.each=feature shouldn't have restarted the browser for different scenarios under same feature file. Browser should have open & closed per feature file.

This is working perfectly fine with below JUnit 4 runner but not with @suite:

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

Serenity BDD version

4.0.29

JDK version

17

Execution environment

No response

How to reproduce the bug.

Sample project with JUnit4 Runner & JUnit Platfor Suite Runner

@gorakshasabnis
Copy link
Author

@wakaleo Can you please help ?

@zetadot
Copy link

zetadot commented May 7, 2024

in think this is related to this issue serenity-bdd/serenity-core#3455

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

2 participants