-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
java.lang.NullPointerException: No BaseStepListener has been registered #1295
Comments
Will downgrade and check if the error really disappears |
Could you check with 1.9.28 and 1.9.10 to see if the error disappears? 1.9.28 is built with cucumber 3.0.0. Failing that, I will roll back the 3.0.0 upgrade. |
hi @kutzi , please provide also a small project to reproduce the issue. How are you running the tests ? |
@cliviu sorry, but that would be very much down on my priority list to provide a test project. So don't expect there anythig soon |
That's how we start Serenity. To create a compehensive, small project to reproduce the issue - I currently lack the time for that. Sorry |
@kutzi is there a reason you are not running the tests through Maven or Gradle? |
@kutzi your way of starting Serenity will not work anymore with the new version. I will take a look to see if I can find an alternative |
did anyone figure out this error yet? I am still running into it. I have tried everything in this thread and every link I can find online and I can't make any progress. in the class StepEventBus.class, this method, the baseStepListener is always null: public void updateOverallResults() { java.lang.NullPointerException |
Are you running the tests with the Serenity runner? |
I am using a test runner file |
Are you trying to run the tests with TestNG? |
yes. I'm trying to set them up to run nightly through jenkins, and I am getting some guidance from another dev at my job, and he said all I need to do is figure out how to run the features by running that testng xml file |
Serenity doesn’t support TestNG |
no way really? no wonder I haven't been able to figure it out. do you know if there is a way to run the features in a similar way, from an xml file through jenkins, using junit? |
Just don’t extend the TestNG base class and run with the JUnit runner insteas |
Back to the original issue: @cliviu did you already manage to find a new way how I could run it? |
@kutzi currently we have switched back to Cucumber 2.x.x |
That means that it should work again? |
Yes, with 1.9.30/1.9.12 |
I upgraded to 1.9.30/1.9.12 and immediately encountered the issue again |
Can you provide a sample project? We are not seeing this problem locally. |
Sorry, but I probably won't find the time to provide a sample project sometime soon |
What I don't get from the reading code: is the baseStepListener optional or not?
but in the codepath from the stacktrace it's not handled as this, i.e. getBaseStepListener() is called without checking isBaseStepListenerRegistered() first |
I found out that this always, consistently happens for the same feature file. I'll share the content of the file - stripped from all potential confidential content - in case it helps:
|
If baseStepListener is null, your test hasn't set up Serenity correctly. If you are starting Serenity using custom logic as mentioned above, you may run into problems if the internal Serenity or Cucumber APIs change. However if this is a case, this isn't a Serenity defect but rather a usage error. We could help with this as part of one of the professional support packages (https://johnfergusonsmart.com/serenity-bdd-mentoring/) if you need further help. I don't see anything odd in the Feature file though. |
@kutzi, the problem is that after "Feature:" you need to start with the feature description. The problem is that you start with the feature description on the next line. |
see here the gherkin doc https://docs.cucumber.io/gherkin/reference/ |
Thanks @cliviu, that did the trick! |
I don`t know if it is late, but try to write your feature description right after Feature: keyword...not with an Enter below...yes it is odd, but I countered with the same issue, and that was the solution... |
That's the Gherkin syntax |
Upgraded to serenity-core/serenity-cucumber 1.9.27/1.9.8 and got this already twice:
(previous versions 1.9.17/1.9.7)
The text was updated successfully, but these errors were encountered: