On Saturday, June 14, 2014 8:40:37 AM UTC-5, Björn Rasmusson wrote:
lots of good stuff; snipped
Okay, thanks for that. I'm really new to Java. (Coming from the Ruby world and not exactly enjoying the transition.) So if you'll bear with me, let's say I want this structure:
src/main/java
src/test/java
src/specs
src/steps
My application code of course lives in src/main/java.
My application unit test code (and the Cucumber-JVM test runner) lives in src/test/java.
My feature files live in src/specs and I can get those to be read by doing this:
@CucumberOptions(features="src/specs")
Now if I want my step definitions to live in src/steps, ideally it would be nice if I could do this:
@CucumberOptions(features="src/specs", steps="src/steps")
I realize I can't, though. So I get what you're saying is that I have to make sure Maven and then Cucumber-JVM know what's in src/steps. But here's my challenge. Let's say my step definition file is ParserSteps.java. Because it tests the application code in src/main/java (specifically a file called Parser.java), my step definition file starts off with:
package nostalgic.textadv.voxam;
import cucumber.api.java.*;
public class ParserSteps {
private Parser parser;
@Given("^the game parser$")
public void the_game_parser() throws Throwable {
parser = new Parser();
}
So my step definition has to include the package of the application that it's testing. So it's not clear to me how I can make my step definitions part of a different package structure such that Maven could find them and compile them while still allowing those step definitions to find the relevant application code.
Does the above make sense in terms of where I'm having trouble figuring this out? I fear I'm making none of this very clear.
- Jeff