2017-09-28 94 views
0

當我調試它時,只有@BeforeClass配置工作 - 它打開瀏覽器並轉到google.com,也在控制檯中我可以看到我的功能的場景,所以Runner看到它。他們都說「測試被忽略」。如果我調試功能(不通過亞軍),他們的工作。我如何從我的Runner運行/調試它們(一次一個)?請幫我找錯Junit Runner不運行黃瓜功能

我的亞軍:

package Runners; 

    import com.codeborne.selenide.Configuration; 
    import com.codeborne.selenide.WebDriverRunner; 
    import cucumber.api.CucumberOptions; 
    import cucumber.api.junit.Cucumber; 
    import org.junit.BeforeClass; 
    import org.junit.runner.RunWith; 
    import org.openqa.selenium.WebDriver; 

    import static com.codeborne.selenide.Selenide.open; 
    import static com.codeborne.selenide.Selenide.sleep; 


    @RunWith(Cucumber.class) 
    @CucumberOptions(
    features = {"src/test/java/Features"}, 
    tags = {"@smokeTest#1"}, 
    glue = "src/test/java/Steps" 

    ) 

    public class Runner { 

     @BeforeClass 
     static public void Initialization() { 
      Configuration.timeout = 1500; 
      Configuration.startMaximized = true; 
      System.setProperty("webdriver.chrome.driver",      
    "src\\test\\repository\\webDriver\\chromedriver.exe"); 
      Configuration.browser = "chrome"; 
      Configuration.savePageSource = false; 
      Configuration.holdBrowserOpen = false; 

      open("https://www.google.ru"); 


      Configuration.savePageSource = false; 

     } 


    } 
+0

該glue選項應該以java包格式 – Grasshopper

+0

更改爲location並且glue =「src/test/java/ru /谷歌/步驟「仍然行不通...或者我誤解了? – Mitch

+0

嘗試ru.google.Steps – Grasshopper

回答

1

愚蠢的,但快速的解決方法,雖然,創建一個類似@WIP一個新的標籤,並用它爲你的唯一的方案。 爲了解決您的問題,請通過在您的IDE上運行>>運行配置來驗證您的運行配置