jeudi 25 février 2016

can not launch cucumber simple test

I have Spring project. Now I try to launch simple cucumber test and got an error((( I thought this is because of Spring so I created separate project with next structure:

src/
|
| --main/
|     --java/
|        --cucumber/
|        --CucumberRunner
|        --features
|          --MyFeatures.feature
|          --StepDefinitions.java

And still I get the same error((

Caused by: java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 28 more

My Runner:

@RunWith(Cucumber.class)
@CucumberOptions(
        format ={"pretty", "json:target/cucumber.json"},
        features = {"src/main/java"}
)
public class CucumberRunner {

}

I know that path is incorrect here but I tried all possible combinations - the result is the same((( My feature:

Feature: Testing my simple kickstarter project

  Scenario: My first test
    Given I navigate to Categories page
    When When I enter 'f'
    Then Error is displayed

My steps:

public class StepDefinitions {
    @Given("^I navigate to Categories page$")
    public void i_navigate_to_Categories_page() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^When I enter 'f'$")
    public void when_I_enter_f() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Then("^Error is displayed$")
    public void error_is_displayed() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }
}

My pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://ift.tt/IH78KX"
         xmlns:xsi="http://ift.tt/ra1lAU"
         xsi:schemaLocation="http://ift.tt/IH78KX ht

tp://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

<groupId>cucumber</groupId>
<artifactId>cucumber</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <!--Cucumber jars-->
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.1.5</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>1.1.5</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.1.5</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>1.1.5</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.1.5</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.3</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-html</artifactId>
        <version>0.2.3</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>gherkin</artifactId>
        <version>2.12.1</version>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.42.0</version>
    </dependency>
</dependencies>

PLease help. I checked google - no result on error((

Aucun commentaire:

Enregistrer un commentaire