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

Breaking Change With Cucumber in Version 2.1.11. Need Assistance Please. #2231

Closed
Warren25 opened this issue Sep 16, 2020 · 3 comments
Closed

Comments

@Warren25
Copy link

Warren25 commented Sep 16, 2020

Current Version Serenity Core: 2.3.2
Current Version Serenity Cucumber: 1.9.51

Previous Version Serenity Core: 2.1.10
Previous Version Serenity Cucumber: 1.9.51

Hi John and team,

I updated my serenity core dependency to 2.3.2 and after rebuilding my project, I saw that my cucumber imports were now invalid.

From the release notes, I see there was a Cucumber update with the 2.1.11 release.

I made the necessary updates in step definition files, for example, changing lines like "import cucumber.api.java.en.Then" to "import io.cucumber.java.en.Then".

However, after making all the updates, and attempting to re-run a test in debug mode, I was met with a null pointer exception.

image

Is this a Cucumber error? Is there a simple fix?

@wakaleo
Copy link
Member

wakaleo commented Sep 16, 2020

You need to use serenity-cucumber6 with serenity-core 2.3.x (see https://github.com/serenity-bdd/serenity-core/blob/master/README.md#what-is-the-latest-stable-version-i-should-use)

@Warren25
Copy link
Author

@wakaleo

Thank you so much for the quick response. This seems like an easy fix/update indeed.

I was reading the pom file in the Cucumber 6 starter project here: https://github.com/serenity-bdd/serenity-cucumber-starter/blob/master/pom.xml

And I was confused by line 16, <serenity.cucumber.version>2.3.4</serenity.cucumber.version>

I thought the latest release of serenity cucumber is v1.9.51, noted in this link: https://github.com/serenity-bdd/serenity-cucumber/releases

@Warren25
Copy link
Author

For reference:

After some moderate reading of several links, I realized I was still using Cucumber 2 with the serenity-cucumber dependency, and needed to use serenity-cucumber6 as @wakaleo mentioned in his previous comment.

With that known, I removed this line: <serenity-cucumber.version>1.9.51</serenity-cucumber.version>, replaced it with this line: <serenity.cucumber.version>2.3.4</serenity-cucumber.version>

I also removed this dependency:

net.serenity-bdd
serenity-cucumber
${serenity-cucumber.version}

And replaced with this dependency:

net.serenity-bdd
serenity-cucumber6
${serenity.cucumber.version}
test

And then finally, after attempting to run a test in de-bug mode, I ran into one final issue, apparently an IntelliJ issue, which I found the solution here: serenity-bdd/serenity-cucumber4#20

Everything is working fine now, as it was.

This issue can be closed.

@wakaleo wakaleo closed this as completed Sep 17, 2020
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

2 participants