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
'No BaseStepListener has been registered' while using Serenity-rest-assured #500
Comments
Could you provide a sample project to reproduce the issue? |
Please find attached the sample project which is reproducing the issue. |
were you able to reproduce the issue with the sample project? |
I have the similar setup as @himukin using Serenity with Serenity Rest Assured. This the only dependencies and plugins I have in the Maven POM:
And I execute the request as following:
The stacktrace is also similar:
Any idea? |
I have the same issue when I'm executing the feature directly from the IDE, in my case IntelliJ. But if execute this from Gradle then it's ok. |
I have the same problem with the project at https://github.com/serenity-bdd/screenplay-pattern-todomvc. With Maven this works when running from IntelliJ it will fail because no BaseStepListener is registered. The IntelliJ runner will set Main class to cucumber.api.cli.Main and the glue to "net.serenitybdd.demos.todos.cucumber.steps net.serenitybdd.cucumber.actors". I even tried to set one manually via StepEventBus.getEventBus().registerListener() but this did not work in the IDE. Any advice what can cause this problem in the IDE? |
I have had the same problem while using Serenity RestAssured.
as a workaround, i switch to original RestAssured in IDE to do the
debugging and revert to Serenity with maven/gradle when the full fledged
report is needed.
…On Thu, Dec 8, 2016 at 9:07 AM, Marcel Szalbach ***@***.***> wrote:
I have the same problem with the project at https://github.com/serenity-
bdd/screenplay-pattern-todomvc. With Maven this works when running from
IntelliJ it will fail because no BaseStepListener is registered. When not
using screenplay pattern it works but when doing anything with Actors it
will fail. The IntelliJ runner will set Main class to cucumber.api.cli.Main
and the glue to "net.serenitybdd.demos.todos.cucumber.steps
net.serenitybdd.cucumber.actors". I even tried to set one manually via
StepEventBus.getEventBus().registerListener() but this did not work in
the IDE. Any advice what can cause this problem in the IDE?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#500 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AByqPaYTFr0rj-wIVV0u7isZPo_asHtpks5rF8jigaJpZM4Jael7>
.
|
How are you running the tests in IntelliJ? |
Did some more tests and seems to work when running via starting an AllRunner like this: When starting directly from a feature file the cucumber plugin of IntelliJ will create an run config with a Cucumber Main class (cucumber.api.cli.Main). This will work for serenity tests but will fail when serenity RestAssured is involved in any step. Guess this is how the others are starting them from IntellliJ? Exception for me is:
I commented out all RestAssured code lines and the error is not thrown anymore. Seems the problem is always an other exception which is not correctly thrown because BaseStepListener is not correctly set when running via the IDE Cucumber Plugin. So seems to be a problem of the Cucumber Plugin since for Maven and the AllRunner everything is working. Will do some more tests tomorrow to also include screenplay but I guess this will also work as long as I start all my tests via AllStories. |
Are you trying to run the tests directly from the feature files? |
Yes the problems happen when running directly from the feature file. |
OK, that's not supported (IntelliJ would need to know about the CucumberWithSerenity runner, which it doesn't). I don't know if there is a way to do that with IntelliJ, but it certainly won't work out of the box. |
With Screenplay tests it may work better as they are more independent of instrumentation |
Thanks for clarification. For me this is fine and I will go with the CucumberWithSerenity runner classes which I can be used from the IDE. |
Thanks for the update. |
Hi John,
the sample project i had attached earlier, reproduces this issue with maven.
…On Thu, Dec 8, 2016 at 3:14 PM, John Ferguson Smart < ***@***.***> wrote:
Closed #500 <#500>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#500 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AByqPUJgnGGzzK8QCdIEiy7o1tcpvtMjks5rGB7egaJpZM4Jael7>
.
|
You need to use the CucumberWithSerenity runner: http://serenity-bdd.info/docs/serenity/#_writing_executable_specifications_with_cucumber_and_serenity |
I am also getting this same error. This is quite weird earlier I was able to run it from feature file also but not suddenly when I try to run it from feature file it is giving me this below error. I was not sure if I did something wrong in my code. I tried to debug but that didn't helped me to reach out this problem. java.lang.NullPointerException: No BaseStepListener has been registered And this is also true that if we run with CucumberWithSerenity runner classes then I can able to run it. But I am not sure if that this is the case then earlier how I was able to run it from feature file... |
You cannot run a Serenity test directly from the feature file. |
I have a same issue when run: mvn clean verify |
That repo is out of date and not maintained. Try with https://github.com/serenity-bdd/serenity-junit-starter. |
but https://github.com/serenity-bdd/serenity-junit-starter. is not enough like junit-webtests |
I'm not sure what you mean. Use any of the starter projects, they are up to date. The projects in the repo you mentioned are not. |
Hi,
I am trying to usering serenity-rest-assured in place of rest-assured, but i get the following exception:
java.lang.NullPointerException: No BaseStepListener has been registered
The text was updated successfully, but these errors were encountered: