Following Steps:
Stories are successfully mapped to the steps and also added maven and selenium dependencies to Pom file, since I have converted the project in test NG wanted to Run it using Test NG. Is it required to Run as Junit. And also added the library for TestNG in Build path.
I just wanted to know what did I miss in the setting up jbehave in my Maven project and how could I run my stories.
Please suggest
Thanks in Advance!
I don't know you found solution for it or not and don't know TestNg but if you want to run it using JUnit make sure you have the following things:
Your java story class should extend org.jbehave.core.junit.JUnitStory
.
Unless configured properly JBehave looks for story file in classpath with a name of the story class. If your story class is "LoginTest" it will look for "login_test.story".
In the story class put this method:
@Override
public InjectableStepsFactory stepsFactory() {
// varargs, can have more that one steps classes
return new InstanceStepsFactory(configuration(), new LoginTestSteps());
}
Then run it as JUnit test from Eclipse.