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: Serenity report is empty when using plugins with junit @ConfigurationParameter #3189

Closed
mrpet88 opened this issue Jul 14, 2023 · 10 comments

Comments

@mrpet88
Copy link

mrpet88 commented Jul 14, 2023

Run sample project with clean test -Dcucumber.filter.tags="@MyTest"
When there is at least one plugin imported with junit @ConfigurationParameter then the report is empty (check screenshot and src/test/java/starter/CucumberTestSuite.java runner)
If the same plugin is referenced through junit-platform.properties then report is showing correctly.

https://github.com/mrpet88/basicProjects/tree/main

Other info:

serenityCoreVersion = '3.6.21'
id "net.serenity-bdd.serenity-gradle-plugin" version "3.6.7"

image

@wakaleo
Copy link
Member

wakaleo commented Jul 17, 2023

@cliviu any idea about this one?

@cliviu
Copy link
Collaborator

cliviu commented Jul 17, 2023

This is strange. @mrpet88 , how are you exactly configuring the plugin using junit-platform.properties?

@mrpet88
Copy link
Author

mrpet88 commented Jul 17, 2023

Hello, not sure what do you mean by "how", but in general the whole junit-platform.properties and serenity-cucumber runner configuration can be found on the attached github repo. More or less the configuration I followed is coming from the instructions:
https://serenity-bdd.github.io/docs/guide/cucumber

@wakaleo
Copy link
Member

wakaleo commented Jul 17, 2023

Found it: you need to also include the Serenity plugin - for some reason if you declare plugins in the runner class, JUnit no longer reads them from the properties file, so you need to do this:

@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")

@mrpet88
Copy link
Author

mrpet88 commented Jul 17, 2023

Indeed, never thought to add the SerenityReporterParallel in the runner class. Works now, thanks!

@wakaleo wakaleo closed this as completed Jul 17, 2023
@allahmalum79
Copy link

allahmalum79 commented Aug 9, 2023

Hello, I am having exactly same issue, i am using MVN and Junit, i am not using cucumber. Can anyone help please?

[INFO] Running Test
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 s <<< FAILURE! - in DashboardTest
[ERROR] DashboardTest Time elapsed: 0.001 s <<< ERROR!
java.util.ServiceConfigurationError: net.thucydides.core.reports.AcceptanceTestReporter: Provider net.thucydides.core.reports.html.HtmlAcceptanceTestReporter could not be instantiated
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:582)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:804)
at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:722)
at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1395)
at net.thucydides.core.reports.ReportService.getDefaultReporters(ReportService.java:231)
at net.serenitybdd.junit.runners.SerenityRunner.getDefaultReporters(SerenityRunner.java:686)
at net.serenitybdd.junit.runners.SerenityRunner.getReportService(SerenityRunner.java:393)
at net.serenitybdd.junit.runners.SerenityRunner.generateReportsFor(SerenityRunner.java:408)
at net.serenitybdd.junit.runners.SerenityRunner.generateReports(SerenityRunner.java:308)
at net.serenitybdd.junit.runners.SerenityRunner.run(SerenityRunner.java:261)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.thucydides.core.reports.templates.TemplateManager
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:948)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:994)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:944)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:983)
at net.thucydides.core.reports.html.HtmlReporter.(HtmlReporter.java:50)
at net.thucydides.core.reports.html.HtmlReporter.(HtmlReporter.java:45)
at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.(HtmlAcceptanceTestReporter.java:60)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:780)
... 16 more

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] Test » ServiceConfiguration net.thucydides.core.reports.AcceptanceTestReporter: Provider net.thucydides.core.reports.html.HtmlAcceptanceTestReporter could not be instantiated

@allahmalum79
Copy link

can one one help me with above issue please

@wakaleo
Copy link
Member

wakaleo commented Aug 10, 2023

@allahmalum79 that looks like a project-specific dependency issue. If it is urgent we can certainly organise some commercial support to get you unstuck.

@allahmalum79
Copy link

allahmalum79 commented Aug 10, 2023

Screenshot 2023-08-10 at 9 16 49 AM

@wakaleo I Need commercial support, how can i proceed with that

@wakaleo
Copy link
Member

wakaleo commented Aug 10, 2023

@wakaleo I Need commercial support, how can i proceed with that

@allahmalum79 Send me an email at john.smart[at]wakaleo.com and I will send you the details.

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

4 participants