Our current testing framework is running with junit + spring + selenium.
Our tests use both junit's org.junit.runner.notification.RunListener
s and spring org.springframework.test.context.TestExecutionListener
s.
This is how the test definition looks like:
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners(listeners = {MyTestExecutionListener.class})
@ContextConfiguration(locations = {"classpath:/META-INF/spring/my-context.xml"})
public abstract class BaseAutomationTest extends AbstractJUnit4SpringContextTests {
}
My question is where should I write the code that resides in the listeners when using Cucumber?
Please note that this code needs access to the spring's ApplicationContext
.