-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Executing Cucumber tests on Junit5 using the JUnit Platform Suite Engine creates empty html or json reports #2441
Comments
Interesting. As a work around you can use an annotation on @Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("io/github/bonigarcia")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.github.bonigarcia")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "html:target/foo.html")
public class CucumberTest {
} |
mpkorstanje
added a commit
that referenced
this issue
Dec 20, 2021
mpkorstanje
added a commit
that referenced
this issue
Jan 1, 2022
mpkorstanje
added a commit
that referenced
this issue
Jan 1, 2022
mpkorstanje
added a commit
that referenced
this issue
Jan 1, 2022
mpkorstanje
added a commit
that referenced
this issue
Jan 1, 2022
mpkorstanje
added a commit
that referenced
this issue
Jan 1, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue
When executing Cucumber tests on Junit5 using the JUnit Platform Suite Engine an empty html and/or json report file is created upon test completion.
The cause of the issue is that 2 instances of CucumberTestEngine get created as part of the process with the second instance created after the tests have completed. The creation of this second instance instantiates a new version the plugins and the constructor of the HtmlFormatter overwrites the already created file.
The first instance of CucumberTestEngine is created indirectly via the creation of the SuiteTestEngine and the second directly via the classloader.
To Reproduce
The simplest example can be found by git cloning into the repo https://github.com/bonigarcia/mastering-junit5 and building the junit5-cucumber sub-project using Java 8 and maven. Once built follow these steps:
Expected behavior
Html reports are generated successfully when using the JUnit Platform Suite Engine to execute cucumber tests
Context & Motivation
I'd like to be able to migrate fully to Junit5 for all testing frameworks and preserve the current generation of html reports feature
Your Environment
The text was updated successfully, but these errors were encountered: