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: First domain object
From the course: Cucumber Essential Training
Step definitions: First domain object
- It seems like the Menu Management feature steps are still highlighted. Let me go ahead and close the file, double click the feature file, and open it again. And you will notice that my scenario steps are no longer highlighted. This is because Cucumber plugin found a link between each of these scenario steps, and their corresponding Menu Management steps are in the Step Definitions file. Let's go back to the Step Definitions file, and let's go ahead and implement the first method. So, I'm going to delete this auto-generated code, and let's go ahead and create a restaurant menu item. So, what we're going to do here is define a restaurant menu item, call it NewMenuItem. And let's go ahead and create this new menu item. This is the constructor call. And I should be able to pass the name, which is coming here. I'm going to give it a nice name, such as NewMenuItemName. And, for the sake of simplicity, I'm just keeping the price as Integer, but we're going to fix that in another scenario…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
User story session: The problem domain2m 16s
-
(Locked)
User story session: Concrete examples2m 23s
-
Feature file7m 19s
-
(Locked)
Step definitions: Generate code3m 29s
-
(Locked)
Step definitions: First domain object2m 14s
-
(Locked)
Step definitions: Next scenario step3m
-
(Locked)
Step definitions: Testing scenario2m 1s
-
(Locked)
Running a test: Create a test runner4m 45s
-
(Locked)
Running a test: Maven test1m 31s
-
(Locked)
-
-
-
-
-
-