admin管理员组文章数量:1123508
- my env: Java+Spring+Cucumber
- what I want: I need move all steps definition to the shred library. It means, that In my test project I have only cucumber's features, properties and runner class:
@Cucumber
@IncludeEngines("cucumber")
@SelectClasspathResource("com/tests")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.runner.project.test")
public class RunnerTest {
}
- What I do: I create library with step's definition classes and configuration class and include it with maven in my test project. Configuration class in library located in 'com.runner.project.test' package.
- what I get: I run testcase ('.feature') and it runs successfully. Than I run 'RunnerTest.class' and take trouble: 'io.cucumber.core.backend.CucumberBackendException: Please annotate a glue class with some context configuration.'
- what I try: I relocate my configuration class from library to the my test project. Than I get trouble with step's definition: application doesn't see definition classes. But if I ctrl+LM on step in testcase '.feature', than I'm falling to the definition step.
- question: How I can linked RunnerTest.class and configuration class located in library?
Configuration class:
@CucumberContextConfiguration
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
@EnableConfigurationProperties
@EnableAutoConfiguration
@ComponentScan
@Import(Config.class)
public class MyTestContext {
@Configuration
public static class Config {....}
本文标签: javaHow move CucumberContextConfiguration class to the libraryStack Overflow
版权声明:本文标题:java - How move CucumberContextConfiguration class to the library? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736575149a1944839.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论