2

I have this step implementation

Given /^entity URI "([^"]*)"$/ do |arg1| @entityUri = arg1 end

I copied this step from an existing feature file to a new feature file

 Given entity URI <Entity Resource URI> 

Cucumber states 1 scenario (1 undefined) 8 steps (2 skipped, 4 undefined, 2 passed) 0m0.009s

You can implement step definitions for undefined steps with these snippets:

Given /^entity URI "(.*?)"$/ do |arg1| pending # express the regexp above with the code you wish you had end

P.S: I checked the directory structure of my old and new feature files and they are at the same level. Even this solution did not work for me: Cucumber: undefined step, although step should be defined

2 Answers 2

3

Based on the step matcher regex, I'd expect the step to match with double-quotes around the step:

Given entity URI "<Entity Resource URI>" 
Sign up to request clarification or add additional context in comments.

Comments

0
Check with the folder structure it should be like below Create project folder >Create features folder >Create step definitions folder >Save .rb files here >Save .feature files here. Step definition folder and .feature files should be in the feature file. Even i faced the same issue like you.The folder structure solved my problem. 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.