Closed kutzi closed 6 years ago
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
private static byte run(String[] argv, ClassLoader classLoader) throws IOException {
RuntimeOptions runtimeOptions = new RuntimeOptions(new ArrayList<String>(asList(argv)))
ResourceLoader resourceLoader = new MultiLoader(classLoader)
Configuration systemConfiguration = Injectors.getInjector().getInstance(Configuration.class)
Runtime runtime = CucumberWithSerenity
.createSerenityEnabledRuntime(resourceLoader, classLoader, runtimeOptions, systemConfiguration)
runtime.run()
return runtime.exitStatus()
}
That's how we start Serenity. If you have any specific question, please let me know.
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() { this.baseStepListener.updateOverallResults(); }
java.lang.NullPointerException at net.thucydides.core.steps.StepEventBus.updateOverallResults(StepEventBus.java:686) at net.serenitybdd.screenplay.EventBusInterface.updateOverallResult(EventBusInterface.java:29) at net.serenitybdd.screenplay.Actor.perform(Actor.java:115) at net.serenitybdd.screenplay.Actor.attemptsTo(Actor.java:86) at net.serenitybdd.screenplay.Actor.has(Actor.java:73)
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? That seems to hint that it's optional
/**
* A reference to the base step listener, if registered.
*/
private BaseStepListener baseStepListener;
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:
Feature:
Make sure that the xyz rewrite rules still work.
Description: a
b
c
d
Scenario Outline: Test if the rewrite anchor points are still present on a Ticket Page
Given the customer opens the <TicketPage>
Then validate that in the bodyElement the marker attribute mainBody is present
# TODO: adapt and re-enable these tests:
# Then ensure that the stickyPricebarDiv contains the sticky-pricebar class attribute
# Then ensure that the countDownDiv contains the coundown class attribute
Examples:
|TicketPage|
|games.APage|
|games.BPage|
|games.CPage|
|games.DPage|
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! Note that this did work before (in 1.9.17), but as you pointed out, this syntax was never allowed, so I wouldn't call it a regression.
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)