Ethan Miller
Ethan Miller

Reputation: 571

Set Glue Code to External Libraries in Cucumber

We have multiple testing repos, and some of the scenarios depend on the steps already created in a separate repo, so I'm trying to build the JAR file and include it in the external libraries of the other repo. Then I define my gluecode in the IntelliJ runner with two separate lines:

com.edge.automation
C:\Users\MY_NAME\.m2\repository\com\reissue-automation\2.0.3-SNAPSHOT\reissue-automation-2.0.3-SNAPSHOT-tests.jar!\com.reissue.automation.stepdefinitions

IntelliJ is able to recognize the Gherkin sentence, but when I run it, it is throwing this exception:

eissueautomationstepdefinitions'
    at io.cucumber.core.options.CucumberPropertiesParser.parseAll(CucumberPropertiesParser.java:156)
    at io.cucumber.core.options.CucumberPropertiesParser.parse(CucumberPropertiesParser.java:88)
    at io.cucumber.core.cli.Main.run(Main.java:48)
    at io.cucumber.core.cli.Main.main(Main.java:33)

Does anybody know what this error means or if it's possible to include glue code from external libraries?

Upvotes: 0

Views: 832

Answers (2)

Pablo
Pablo

Reputation: 1

May you add the detailed steps on how you accomplish it? I tried running

mvn install dependency:copy-dependencies -DskipTests

And then running my maven command for running the test cases and not luck.

If you can add your folder structure and how you put it in the glue code of cucumber runner will be appreciated. Also cucumber version might help.

Thanks

Upvotes: 0

Ethan Miller
Ethan Miller

Reputation: 571

I ended up running the following command to copy my dependencies into the target folder which added it to the classpath.

mvn install dependency:copy-dependencies -DskipTests

Then it picked up the glue no problem.

com.edge.automation
com.reissue.automation.stepdefinitions

If anyone has a better solution feel free to post.

Upvotes: 1

Related Questions