Which version of cucumber supports cucumber expressions | Selenium Forum
P
Pavan Posted on 03/06/2021

Hi Team,

can you please help me with the cucumber version from which cucumber expressions support is added.

I have created a feature file by passing some dynamic data in the test steps.
I have run the project without creating the step definitions. The skeleton of step definitions is generated but it is showing with the regular expressions. 

 

Feature file:
@Login
Scenario: Login to the e-commerce site
Given User should log in to 'Amazon' site
And I want to buy an 'Apple-Iphone'
And If the sale is on I want to buy 2 sets of phone

 

Step definations: - Generated with regular expressions

@Given("^User should log in to 'Amazon' site$")
public void user_should_log_in_to_Amazon_site() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

@Given("^I want to buy an 'Apple-Iphone'$")
public void i_want_to_buy_an_Apple_Iphone() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

@Given("^If the sale is on I want to buy (\\d+) sets of phone$")
public void if_the_sale_is_on_I_want_to_buy_sets_of_phone(int arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}

 

 

 


A
Ashish Thakur Replied on 09/06/2021

You can use cucumber 6 and it will support