Hello!
How can we glue step definition from a .jar file?
For example, i have couple of projects with different feature files. Most of the step definitions are common. Can i keep these step definitions in a .jar file and pass the package name to cucumber "--glue" option? I tried doing it but it says steps are undefined. Is there anyway to use these step definitions as a common library? so that i do not have to maintain the same code in different projects?
BTW - I am running them as a Maven command.
Appreciate your help! Please feel free to bug me for more details.
Thanks,
V
Hello!
How can we glue step definition from a .jar file?
Hi Paolo,
Sorry, here is the dependency snippet from POM file:
<dependency>
<groupId>com.automation.common</groupId>
<artifactId>common</artifactId>
<version>0.0.1</version>
</dependency>
Hey Roberto,I am sorry ... just saw your message. Still no luck :(I am not able to download your attachment ... it shows just 1KB. Is it possible to share the code in JUnitWrapper?
package org.agileware;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)@CucumberOptions(features="src/test/resources")public class JUnitWrapper {
}
Feature: feature description @xyzScenario: test Given something When an event occurs Then something else happens
package org.agileware.stepdefs;
import cucumber.api.java.en.Given;import cucumber.api.java.en.Then;import cucumber.api.java.en.When;
public class StepDef {
@Given("something$") public void given() { System.out.println("Given"); } @When("an event occurs") public void when() { System.out.println("When"); } @Then("something else happens") public void then() { System.out.println("Then"); }}
Hi Roberto,Every thing is same like mine. Not sure what is wrong here. Just for re-confirmation, your JUnitWraper and Feature files are in one project and Stepdefs are in a different jar correct?
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/Rd83aDHSgMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
Hi Roberto,Thanks for your time. I am still facing same issue :( I guess some version or configuration my machine is causing the problem.
Disclaimer: This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake, please delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.