From the course: Cucumber Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Step definitions: Generate code

Step definitions: Generate code

From the course: Cucumber Essential Training

Start my 1-month free trial

Step definitions: Generate code

- The next step is to create step definitions. So this is how our feature file looks like. Let's first examine why the steps in our feature file are high lighted. If I hover my mouse pointer to one of these exclamation marks, it tells me that I have a step that does not have matching glue code. That means it does not have a matching step definition. So let's go ahead and implement a step definition. I'll go ahead and create a package here, and call my package "step definitions". Click "finish", and I have my package here. A step definition file is nothing more than just a plain and simple Java class. So let's go ahead and create one. And I'll call it "menu management steps". Click finish. From our previous step, I already have the implementations of the three methods here. So I'll just go ahead and copy the three methods, and paste those here. I need to import a few packet names here. Let me go ahead and do that. And, my step definitions file is done. Let's examine the generated…

Contents