serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

Cucumber5 incompatibility #225

Closed alvigo92 closed 4 years ago

alvigo92 commented 4 years ago

The package serenity-core (version 2.2.0) has been updated to work with Cucumber 5.5, but the class CucumberWithSerenity is still using some java classes from older versions of cucumber, making it imposible to be used. image

wakaleo commented 4 years ago

Cucumber 5 has changed some of the class locations - just delete your imports and reimport.

alvigo92 commented 4 years ago

I have already done what you said on my project files, but i am having problems with that file, that actually is from this project.

wakaleo commented 4 years ago

Ah, I see. serenity-core 2.2.0+ is only compatible with Cucumber 5, so must be used with serenity-cucumber5 (https://github.com/serenity-bdd/serenity-cucumber5). This repo is for Cucumber 2.x, which is deprecated.

cliviu commented 4 years ago

it will be this class https://github.com/serenity-bdd/serenity-cucumber5/blob/master/src/main/java/net/serenitybdd/cucumber/CucumberWithSerenity.java

alvigo92 commented 4 years ago

Ok. With that version my project compiles fine. But the glue is not working properly. As far as i have read, the cucumber options, have changed. How am i supposed to do it? Actually i am using them like this:

@CucumberOptions( features = {"directory"}, plugin = {"pretty", "html:target/cucumber", "json:target/cucumber-report.json"}, glue = {"package1", "package2"})

I am talking about this, because i see this new warning: WARNING: Passing commandline options via the propertycucumber.optionshas been deprecatedin favour of explicitly using property names. Please use these instead: [cucumber.ansi-colors.disabled, cucumber.execution.dry-run, cucumber.execution.limit, cucumber.execution.order, cucumber.execution.strict, cucumber.execution.wip, cucumber.features, cucumber.filter.name, cucumber.filter.tags, cucumber.glue, cucumber.object-factory, cucumber.plugin, cucumber.snippet-type]

wakaleo commented 4 years ago

You can ignore that warning for now.

alvigo92 commented 4 years ago

The problem I have is that the steps from package2, are being ignored.

wakaleo commented 4 years ago

I don't think the warning is related to the @CucumberOptions annotation - its about how you pass options through on the command line.

alvigo92 commented 4 years ago

Ok. I will work on it, and try to find out whats going on. Thank you very much.

sricharanya commented 4 years ago

The warning resolves once the command line options are passed in the newer format. e.g. -Dcucumber.fiter.tags ="@some_tags" -Ducucumber.filter.name="^My test scenario$"