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 4, Junit 5 Cucumber Runner is throwing exception: java.lang.NullPointerException: No BaseStepListener has been registered - are you running your test using the Serenity runners? getting this error in serenity report for Serenity 4 Junit5 Cucumber testcases #3549

Open
gem-kirankumari opened this issue Sep 27, 2024 · 6 comments

Comments

@gem-kirankumari
Copy link

What happened?

We are using cucumber runner and our custom listener:

import org.junit.platform.suite.api.ConfigurationParameter;
import org.junit.platform.suite.api.IncludeEngines;
import org.junit.platform.suite.api.SelectClasspathResource;
import org.junit.platform.suite.api.Suite;
 
import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME;
 
@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("/features")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME,
                        value = "io.cucumber.core.plugin.SerenityReporterParallel,pretty,timeline:target/test-results/timeline")
public class CucumberTestSuite {
}

Serenity version: 4.1.14
Serenity-Junit5: 4.1.14
junit-jupiter-engine: 5.10.2
cucumber-core: 7.17.0
Build Tool: Gradle 8.1

The testcase is working fine but it is breaking at Serenity.recordReportData().withTitle().andContents() line. In report the error is
**No BaseStepListener has been registered - are you running your test using the Serenity runners? ** and in console it prints current listener is null. We are not using base step listener, we are extending Abstract step Listener in our custom listener.

This is happening only with Serenity 4, Junit 5 cucumber testcase.

What did you expect to happen?

I exepected that serenity report was generated without any error as it is generating for junit 5 testcase.

Serenity BDD version

4.1.14

JDK version

17.0.1

Execution environment

Windows
Browsers - all are giving error

How to reproduce the bug.

Can't share the repository.

How can we make it happen?

Add it to the Serenity BDD backlog and wait for a volunteer to pick it up

@gem-kirankumari
Copy link
Author

@wakaleo Can you please look into it asap?

@wakaleo
Copy link
Member

wakaleo commented Sep 27, 2024

@wakaleo Can you please look into it asap?

Sure, we can help take a look at that for you. If you have an active commercial support contract, just let me know via email - if not, please take a look at the support options here: https://www.serenitydojo.academy/serenity-bdd-support-packages-page - once you decide the option that would work for you, you can get in touch using the form on the page or email me directly (john.smart[at]wakaleo.com)

@gem-kirankumari
Copy link
Author

@wakaleo did you find anything missing in our configuration? Please let us know.
We appreciate your prompt assistance.

@wakaleo
Copy link
Member

wakaleo commented Sep 27, 2024

Did you send us a support request? I haven't seen anything come through but let me know and I can check.

@ak270296
Copy link

ak270296 commented Sep 30, 2024

You have the below dependency in your pom.xml if not please add and check.

<plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>${serenity.version}</version>
                <configuration>
                    <tags>${tags}</tags>
                    <reports>single-page-html</reports>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>net.serenity-bdd</groupId>
                        <artifactId>serenity-single-page-report</artifactId>
                        <version>${serenity.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin> 

@gem-kirankumari
Copy link
Author

@ak270296 we are using gradle as build tool, we have serenity-gradle plugin added and we are using single-page-html report also.

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