2017-09-28 97 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上运行>>运行配置来验证您的运行配置