1

I am a beginner to Cucumber. I have installed cucumber by the help of internet. I have written a .feature file. But I don`t know where to place this file and how to execute it.

1

1 Answer 1

1

Because it wants you to succeed in BDD, cucumber will guide you through the process. From the project directory, type cucumber in the cmd prompt or terminal, which returns:

You don't have a 'features' directory.  Please create one to get started.

Create a features directory, and put your .feature file in it. Again, run cucumber, which returns pending step definitions that map to your feature file. As an example:

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

Given /^I want to use cucumber$/ do
  pending # express the regexp above with the code you wish you had
end

Now--as @siekfried indicates--create a directory called features/step_definitions for your step definition files, which should end with _steps (e.g. example_steps.rb). Then, edit your step definition file with the appropriate code to execute the step.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.