Tag: 黄瓜

我如何得到一个黄瓜功能的结果

我正在尝试在JUnit 5 Jupiter中运行Cucumber功能。 我已经从Cucumber-jvm源代码中提取了一些代码,并将其用于JUnit 5的TestFactory 。 它正在工作:当我运行所有JUnit测试(这是Kotlin代码,但同样适用于Java)时,我看到我的功能正在运行: @CucumberOptions( plugin = arrayOf("pretty"), features = arrayOf("classpath:features") ) class Behaviours { @TestFactory fun loadCucumberTests() : Collection<DynamicTest> { val options = RuntimeOptionsFactory(Behaviours::class.java).create() val classLoader = Behaviours::class.java.classLoader val resourceLoader = MultiLoader(classLoader) val classFinder = ResourceLoaderClassFinder(resourceLoader, classLoader) val runtime = Runtime(resourceLoader, classFinder, classLoader, options) val cucumberFeatures = options.cucumberFeatures(resourceLoader) return cucumberFeatures.map<CucumberFeature, DynamicTest> […]

如何让黄瓜让Spring注入一步定义类?

我有一个SpringBootApplication执行Cucumber(不作为测试的一部分,但作为主要的应用程序。 我碰巧在Kotlin做到这一点,但那不重要。 这是应用程序类。 demo02的主体是从一些黄瓜来源复制,一直工作正常。 我认为这没什么不妥。 package cutest import … @CucumberOptions(tags = arrayOf("not @ignore"), features = arrayOf("sandbox/cutest/src/main/resources"), // features = arrayOf("src/main/resources"), format = arrayOf( "pretty", "html:target/site/cucumber/cucumber", "json:target/failsafe-reports/cucumber.json" ), strict = true) @SpringBootApplication open class CucumberApplication { @Bean open fun demo02() = CommandLineRunner { val cl : ClassLoader = javaClass.getClassLoader() val rl = MultiLoader(cl) val roFactory = […]