tijnn
tijnn

Reputation: 416

does not have a matching glue code

I'm trying to get cucumber to working in Eclipse...

the message is: does not have a matching glue code

I'm following the steps of this website: https://www.tutorialspoint.com/cucumber/cucumber_java_testing.htm

but the thing is while you do exactly what the website says, all kinds of things happen that isn't in the description... f.e. de cucumber.api is created. (the website doesn't say anything about that) is it better/improved? or unnecessary? (i don't know)

what is wrong with this code, (please help)?

package cucumber.api;

import cucumber.junit.Cucumber;

public class CucumberOptions {
    @Cucumber.Options(format = {"pretty", "html:target/cucumber"}
    ,glue={"cucumberJava"}
)
}

enter image description here

enter image description here

also: I can start the runTest.java the browser FireFox opens but then nothing happens.... why doesn't it continue? why does it say: does not have a matching glue, but runs?

enter image description here

Upvotes: 0

Views: 3037

Answers (1)

Grasshopper
Grasshopper

Reputation: 9058

This tutorial is outdated. This refers to cucumber 1.0.2 and the latest version is 3.0.2. Cucumber.Options is deprecated and it is replaced by CucumberOptions annotation. Find a more recent one.

Coming to the code, the Cucumber.Options annotations needs to be on the class level like below. Also you are missing the cucumber runner for executing this class.

@RunWith(Cucumber.class)
@Cucumber.Options(format = {"pretty", "html:target/cucumber"}
    ,glue={"cucumberJava"}
)
public class CucumberOptions {

}

Upvotes: 1

Related Questions