Search code examples
javaspringcucumberspring-bootbdd

Spring Boot BDD Testing with serenity


we have a spring boot application which we want to test via serenity (former Thucydides). Theoretically the tests can be run (if i test for example www.google.com everything works fine) but I want to test my own application and not google ;)

So I need to start the application before running the tests. Normally we have an annotation

@RunWith(SpringJUnit4ClassRunner.class)

at our test class. but with Serenity and cucumber we need

@RunWith(CucumberWithSerenity.class)

and it is not possible to add 2 @RunWith annotations.

What is the best way to get the tests wit Serenity and Cucumber running?


Solution

  • Upgrade to Spring 4.2.1 and you should be able to use the Serenity runner:

    http://docs.spring.io/spring/docs/4.2.1.RELEASE/spring-framework-reference/htmlsingle/#testcontext-junit4-rules