Join Shashi Shekhar for an in-depth discussion in this video Background: Duplicate item, part of Cucumber Essential Training.
- [Instructor] So we need to add a duplicate check … to our restaurant menu class. … This is the class that holds an array list … of restaurant menu items. … So, what I'm going to do here is … add a check which will say if DoesItemExist, … newMenuitem. … Throw an exception if that happens. … So, let's throw new Illegal ArgumentsException. … And supply some text here. … Let me fix this. … And let's go ahead and run our test again. … We have a problem. … What happened in the case of our third menu item addition? … We are getting a duplicate item exception. … And the reason for that is, … if you go back to the menu management feature file, … background runs before each scenario, … so when it runs for the first two scenarios, … they have items with different names, … but when it runs for the third scenario, … it already has an item with the name, chicken sandwich, … so that's a duplicate. … The problem is, … our test cases are not written to handle that. … How about we make a few additional changes to handle that. …
- How Cucumber can be used for BDD, TDD, and ATDD
- Installing and configuring Cucumber
- Mapping user stories to features
- Adding hooks
- Generating reports
- Adding a data table
- Adding Selenium dependencies
- Applying techniques to make BDD maintainable
Skill Level Intermediate
Robot Framework Test Automation: Level 1 (Selenium)with Bryan Lamb6h 23m Intermediate
1. Behavior-Driven Development
2. Cucumber Workflow
3. Regular Expressions Match
4. Additional Cucumber Concepts
5. Data Table and Scenario Outline
6. Cucumber Advance Features
Next steps1m 7s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.