0

I have designed my FW and I have exactly placed runner and step files in the package. But I am not able to run the TC, it saying Test pending though steps are defined.

PFA my project structure. enter image description here

My step file:

package com.reThink.steps;

import net.thucydides.core.annotations.Steps;

import com.reThink.helper.LoginHelper;
import com.reThink.util.CBTestProperties;
import com.reThink.util.Constants;
import com.reThink.util.Log;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;

public class LoginSteps {

@Steps
LoginHelper loginHelper;

private String username = null;
private String password = null;

/**
 * Method to navigate to login page
 * 
 * @param
 * @return
 */
@Given("^I am on the reThink Login page$")
public void givenIamonthehomepage() throws Exception {
    loginHelper.openLoginPage();
}

/**
 * Method to login as a Admin user
 * 
 * @param
 * @return
 */
@When("^I login as an Admin user$")
public void loginWithAdminUser() throws Exception {
    loginHelper.openLoginPage();
    username = CBTestProperties.Instance
            .getTestProperty(Constants.ADMINUSERNAME);
    password = CBTestProperties.Instance
            .getTestProperty(Constants.ADMINPASSWORD);
    loginHelper.loginToRethink(username, password);
}

/**
 * I should be login successfully
 * 
 * @param
 * @return
 */
@Then("^I should be logged in successfully$")
public void thenItShouldBeLoggedIn() throws Exception {
    // assertThat(homePageHelper.isLoginSuccessful(username));
    Log.info("Successfully logged in");
}

}

Feature file

@Logon_Admin_User
Scenario: Login to reThink with Admin User credentials 
Given I am on the reThink Login page
When I login as an Admin user 
Then I should be logged in successfully 
Kiran
  • 1
  • 1
  • 3

1 Answers1

1

You are missing glue path in cucumber options of runner class. Please try with followings.

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features="src/test/resources/features",tags="@Logon_Admin_user",glue = { "com.reThink.steps" })
public class TestRunnerSuite{}
Murthi
  • 5,299
  • 1
  • 10
  • 15