Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 1.33 KB

README.md

File metadata and controls

37 lines (31 loc) · 1.33 KB

Stories in Ready Build Status

This project provides a useful base class for running JBehave test scenarios with injected steps using Spring.

Usage:

1 - Add dependency.

<dependency>
    <groupId>com.agilarity</groupId>
    <artifactId>jbehave-spring-stories</artifactId>
    <version>1.0.3</version>
</dependency>

2 - Add a Spring annotated resource class.

@Configuration
@ComponentScan("com.agilarity.examples.smoke.steps")
public class SmokeTestResources {

}

3 - Specify the resource in your test class.

    public class SmokeTest extends SpringJBehaveStories {
    
        @Override
        protected String[] getSpringResources() {
            return new String[] { SmokeTestResources.class.getName() };
        }
    }

4 - Add the @Component annotation to you steps so Spring will wire it up.

5 - Put your story files under src/test/resources, at or below the same package as your test class.

6 - Run your test class as a normal JUnit test.