2017-02-03 80 views
0

我使用Springboot與寧靜作爲用戶界面測試框架,我想添加黃瓜到我的項目。 我的問題是,測試將無法啓動我的Springboot測試應用程序。你能幫我麼? 我的依賴關係:寧靜與黃瓜和Springboot

testCompile("net.serenity-bdd:serenity-core:${serenityVersion}") 
testCompile("net.serenity-bdd:serenity-junit:${serenityVersion}") 
testCompile("net.serenity-bdd:serenity-spring:${serenityVersion}") 
testCompile("net.serenity-bdd:serenity-cucumber:${cucumberVersion}") 

testCompile("info.cukes:cucumber-java:1.2.5") 

我的寧靜/黃瓜測試(FrontendTestApplication標註有@SpringbootApplication):

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, classes = {FrontendTestApplication.class}) 
@RunWith(CucumberWithSerenity.class) 
public class InputStationCucumber { 
} 

如果我跑我的老測試,寄託都工作正常,但此測試不啓動我的Springboot應用程序。

你們能幫我嗎?

問候, 拉爾斯

回答

0

我發現了錯誤。 你必須用@SpringBootTest註解定義類的步驟,而不是跑步者類。