0

I am developing a test for an Android app using cucumber-jvm. I wrote a feature and the corresponding steps. The console says that there is any test.

Did you have already this problem?

I don't know exactly what I'm doing wrong.

Running tests Test running startedTest running failed: No test results Empty test suite.

"StepsDefinitions.java"

@CucumberOptions(features = "features")


public class StepsDefinitions  extends ActivityInstrumentationTestCase2<LoginActivity> {
        public StepsDefinitions() {
            super(LoginActivity.class);
        assertNotNull(getActivity());
        Log.i("That","It is running.");
    }

    @Given("^I have a UserBox$")
    public void I_am_on_the_Login_Screen() {

        EditText etLoginUser =  (EditText) getActivity().findViewById(R.id.User);
        assertNotNull(etLoginUser);
    }
    @Then("^I should see on the display$")
    public void I_should_see_s_on_the_display() {
        EditText display = (EditText) getActivity().findViewById(R.id.Pass);

    } }

enter image description here

Alfaplus
  • 1,713
  • 2
  • 19
  • 29

1 Answers1

1

Do you have the Runner class? You just need a small 'marker' class to tell JUnit to invoke the Cucumber test suite (put it in the same package as your StepDefinitions).

import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
public class RunCukesTest {
    // No further code needed
}
BarrySW19
  • 3,759
  • 12
  • 26