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

Update maven dependencies #18

Open
BartVanRaemdonck opened this issue Dec 4, 2019 · 6 comments
Open

Update maven dependencies #18

BartVanRaemdonck opened this issue Dec 4, 2019 · 6 comments

Comments

@BartVanRaemdonck
Copy link

BartVanRaemdonck commented Dec 4, 2019

Is it possible to update the cucumber starter project for Maven with the latest versions?

I think it are the following versions but I get an error:

Caused by: java.lang.ClassNotFoundException: io.cucumber.core.options.CucumberOptionsAnnotationParser$OptionsProvider

   ``` <serenity.version>2.0.89</serenity.version>
    <serenity.maven.version>2.0.89</serenity.maven.version>
    <serenity.cucumber.version>1.9.45</serenity.cucumber.version>
    <cucumber.version>4.8.0</cucumber.version>```
 <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <version>${serenity.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.cucumber</groupId>
                    <artifactId>cucumber-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-junit</artifactId>
            <version>${serenity.version}</version>
            <scope>test</scope>
        </dependency>


@wakaleo
Copy link
Member

wakaleo commented Dec 4, 2019

Serenity cucumber should be 1.0.22

@BartVanRaemdonck
Copy link
Author

That dependency is not found:

The POM for net.serenity-bdd:serenity-cucumber:jar:1.0.22 is missing, no dependency information available

@wakaleo
Copy link
Member

wakaleo commented Dec 4, 2019

The pom you are showing is for cucumber 4, so you need serenity-cucumber4

@BartVanRaemdonck
Copy link
Author

Now I get:

java.lang.NoClassDefFoundError: io/cucumber/core/options/FeatureOptions
Caused by: java.lang.ClassNotFoundException: io.cucumber.core.options.FeatureOptions 

Code:


import io.cucumber.junit.CucumberOptions;
import net.persgroep.targetqa.DefaultSuite;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;

@RunWith(CucumberWithSerenity.class)
@CucumberOptions( features = "src/test/resources/features/web", glue = {"net.persgroep.targetqa.stepdefinitions"})
public class WebTest extends DefaultSuite {
}

Dependencies:

	<serenity.version>2.0.89</serenity.version>
        <serenity.maven.version>2.0.89</serenity.maven.version>
        <serenity.cucumber.version>1.0.22</serenity.cucumber.version>
        <cucumber.version>4.8.0</cucumber.version>



 <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <version>${serenity.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.cucumber</groupId>
                    <artifactId>cucumber-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-junit</artifactId>
            <version>${serenity.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-model</artifactId>
            <version>${serenity.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-cucumber4</artifactId>
            <version>${serenity.cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <version>${serenity.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-screenplay</artifactId>
            <version>${serenity.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-screenplay-webdriver</artifactId>
            <version>${serenity.version}</version>
            <scope>test</scope>
        </dependency>

@wakaleo
Copy link
Member

wakaleo commented Dec 9, 2019

NoClassDefFound is always a dependency conflict. But I can't see any obvious issue there - maybe in the maven plugin? Have you done a dependency analysis?

@BartVanRaemdonck
Copy link
Author

BartVanRaemdonck commented Dec 10, 2019

Dependency conflict is resolved, you have to add

            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>${cucumber.version}</version>
        </dependency>

In selenium core it is still 2.4?

Now my test aren't running because there are no features found.

It is still like this right?

import io.cucumber.junit.CucumberOptions;
import net.persgroep.targetqa.DefaultSuite;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(glue ={"net.persgroep.targetqa.stepdefinitions"}, features = "src/test/resources/features/web")
public class WebTest extends DefaultSuite {
}

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