1
votes

When I debug it, only @BeforeClass config works - it opens browser and go to google.com, also in Console I can see Scenarios of my feature, so Runner see it. All of them says "Test ignored". If I debug features (not throught Runner), they work. How can I run/debug them (one at a time) from my Runner? Please, help me to find mistake

My 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;

       }


   }
2
The glue option should be in java package formatGrasshopper
changed to location and glue = "src/test/java/ru/google/Steps" still doesn't work... Or I misunderstood?Mzia
try ru.google.StepsGrasshopper
Didn't work, so I tried glue = "Steps" Thank you!!!Mzia

2 Answers

1
votes

Stupid but quick workaround though, create a new tag like @WIP and use it for your only scenario. And to resolve your issue, verify your Run Configurations by going through Run >> Run Configurations on your IDE

0
votes

As per @grasshopper suggested on comments, the glue option should be in package format.

E.g: If your step definitions are directly under src/test/java/steps you should go with:

@CucumberOptions(features = {"src/test/java/features"}, glue = {"steps"})

In other hand, if your step definitions are under more than one package (e.g.: src/test/java/your.package.steps), you should have something like this:

@CucumberOptions(features = {"src/test/java/features"}, glue = {"your.package.steps"})