Cucumber Predefined steps usage

I have a project where I have written some per-defined steps and implemented.

Now I like to use the per-defined steps in another project in eclipse. Kindly let me know how could I do that?

Upvotes: 0

Views: 629

Answers (1)

Priya P
Priya P

Reputation: 123

Cucumber only knows how to read and execute your feature files because of the step definition files usually defined with in a steps directory. That is where your feature statements are captured by regular expressions and translated to Java code The steps Cucumber will search for just live in a package, or a sub-package from the runner. Suggestion would be to copy the step definitions from Project 2 into your steps directory in Project 1. Also there is way to re-use steps is therefore to package the steps in a jar and add that jar as a dependency. You can use Maven for creating the jar.

Upvotes: 1

Related Questions