How do I define the "I Want" steps from my feature using java?
I have my cucumber project setup like this:
Login.feature
Feature: User Login
I want to test on "www.google.com"
Scenario: Successfully log in
Given I am logged out
When I send a GET request to "/login"
Then the response status should be "200"
Then I have my steps defined like this:
Steps.java
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;
import cucumber.api.java.en.Then;
public class Steps {
@Given("^I am logged out$")
public void i_am_logged_out() {
//do stuff
}
@When("^I send a GET request to \"([^\"]*)\"$")
public void i_send_a_GET_request_to(String arg1) {
//do stuff
}
@Then("^the response status should be \"([^\"]*)\"$")
public void the_response_status_should_be(String arg1) {
//do stuff
}
}
How do I define the "I want" step in Java using cucumber-jvm?
Here's my attempt, but @When
is not a valid annotation.
@Want("to test on \"([^\"]*)\"$")
public void to_test_on(String arg1) {
//do stuff
}