0

I kept my (prefix_name)Runner.java file under _ __src/test/java/(company_domain_package)\runner** _ folder and kept my _(prefix_name)StepDefinitions.java_ file under src/test/java/(company_domain_package)\stepdefinitions folder.

In my Eclipse when I run mvn clean verify, I am only seeing this comment.

"You can implement missing steps with the snippets below:"


and the accompanying empty stub methods automatically generated by Cucumber in the Eclipse console window, instead of running the src/test/java/(company_domain_package)\stepdefinitions\prefix_nameStepDefinitions.java file.

I mentioned in my @CucumberOptions the complete path of feature file (obviously it is being picked up, because the @Given, @When, @Then stub methods are being output in console.

Even though I implemented the @Given Step in my prefixStep.java file which uses (prefix)Page.java to do low level Selenium calls.

What is the omission I am doing ?

I kept my (prefix_name)Runner.java file under src/test/java/(company_domain_package)\runner> folder and kept my (prefix_name)StepDefinitions.java file under src/test/java/(company_domain_package\stepdefinitions) folder.

In my Eclipse when I run "mvn clean verify", I am only seeing this comment "You can implement missing steps with the snippets below:" and the accompanying empty stub methods automatically generated by Cucumber in the Eclipse console window, instead of running the **src/test/java/(company_domain_package\stepdefinitions)(prefix_name)StepDefinitions.java* file.

I mentioned in my @CucumberOptions the complete path of feature file (obviously it is being picked up, because the @Given, @When, @Then stub methods are being output in console.

 public class PramaDatahubPageStep {
 DataHubPage dataHubPage;

   @Step
public boolean loginPramaDatahubSite(String uId, String 
                                              passCode) {
    boolean isVerified = false;
    configureChromeDriver();// private method
            setChromeDriver(); // private method
    dataHubPage.open();
    dataHubPage.login( uId, passCode);
    isVerified = dataHubPage.verifyLogin();
    return isVerified;
}


@DefaultUrl("https://prama-stg.xxxxx.com/datahub")
  public class DataHubPage extends PageObject {
 @FindBy(id = "loginButton")
private WebElementFacade loginButton;

@FindBy(id = "errorDiv") 
private WebElementFacade loginError;

@FindBy(id = "password")
private WebElementFacade password;

@FindBy(id = "eID")
private WebElementFacade userId;

public void login(String uId, String passCode){
    userId.sendKeys(uId);
    password.sendKeys(passCode);
    loginButton.click();
}

I am expecting my StepDifinitions.java file to be run and the web site opened and logged in with the data table provided in the feature file.

PraNuta
  • 629
  • 3
  • 12
  • 33
  • Looks like I found where is my problem, even though I don't know why ! Whether it is src/main/java . OR src/test/java . OR src/test/resources which are pre-existing folders in a maven project, the Serenity is NOT liking to have a company domain package to be put beneath them. When you keep your Java files, whether it is a cucumber Runner file, or stepDefinitions file or step file, no matter it is NOT able or NOT like to see them. When I removed the company domain package and moved the java files directly up to the default folders, it works. – PraNuta Feb 07 '19 at 21:46
  • Can some one explain why ? Technically it should read java files until they are on the class path . Right ? – PraNuta Feb 07 '19 at 21:53
  • I think, I solved this issue, by adjusting the options like - features - glue etc., parameters. More over some times dependencies in your pom file also have some affect, I suppose. – PraNuta Feb 13 '19 at 18:22
  • features - glue etc., parameters in the Runner java file – PraNuta Feb 13 '19 at 19:11

0 Answers0