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: Testing scenario
From the course: Cucumber Essential Training
Step definitions: Testing scenario
- [Presenter] So our developmenting has implemented all the three methods in our step definitions file. We have the first method, where they're adding a restaurant menu item with name, description and price. In the second step, they define the location menu which is of the type restaurant menu. Let me show you that class. This class holds an array list of menu items or restaurant menu items and it has a method that allows you to add a menu item to that array list. Let's go back to the step definitions file and the last method is where its checking if an item exists. So the item which is added in this method, which is I add that menu item, should be available in the location menu object and that's what it tests. For each of these steps we have some Sys.out, so you can see some messages and some values. So lets go ahead and run our feature file and see what happens. I'm going to minimize this from the feature file and if you see in the output all the three steps ran and we have those…
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)
-
-
-
-
-
-