Relative path issue for @CucumberOptions while executing from JAR

404 views
Skip to first unread message

Achintya Sett

unread,
May 7, 2020, 4:48:04 AM5/7/20
to Cukes

Hi all,

I am having trouble using the relative path in @CucumberOptions parameters such as features & glue.

Please find a brief description of my project below:--
  • Maven Project (Please find the pom.xml attached)
  • Maven Assembly Plugin
  • Cucumber v1.2.6 (groupId = info.cukes)
  • Extended Cucumber Runner v1.3.5 (groupId = com.github.mkolisnyk)
  • Selenium v3.141.59 (groupId = org.seleniumhq.selenium)
  • IntelliJ Idea IDE

My project structure looks like this:--



After "mvn clean package" target folder looks like below:-



features parameter is only accepting the path from project root and nothing else works:---

        features = { "src/test/resources/features" },  // ==> Working on IDE, NOT WORKING in JAR 
features = "classpath:features", //==> Not Working in both IDE & JAR
features = "features", //==> Not Working in both IDE & JAR

glue parameter is only accepting the package path and nothing else works:---


glue = { "com/croma/automationqa/stepDefinitions" }, // ==> Working in IDE
glue = { "src/test/java/com/croma/automationqa/stepDefinitions" }, //==> Not Working in IDE
glue = { "stepDefinitions" }, //==> Not Working in IDE
glue = { "classpath:stepDefinitions" }, // ==> Not Working in IDE


Please find CucumberRunner.java file attached.

I want a way in which I would be able to execute the project from both IDE & Maven assembled JAR file with same @CucumberOptions configuration.
As per my understanding using "classpath" should have been the best option.
But unfortunately it is not working on my setup.


Can you kindly help on this?

Also, please let me know if you find any issue in my JAR Classpath setup in pom.xml.

Thanks in advance!!

pom.xml
CucumberRunner.java
Reply all
Reply to author
Forward
0 new messages