Join Shashi Shekhar for an in-depth discussion in this video Cucumber hooks: Adding hooks, part of Cucumber Essential Training.
- [Instructor] Cucumber Hooks. … If you have worked with unit testing tools before, … you have probably seen setup and teardown methods. … That's exactly what Cucumber Hooks use. … Cucumber Hooks are classes that contain methods … that have special annotations, namely before and after, … and those methods execute before or after each scenario. … Let's see Cucumber Hooks in action. … I'm going to define my hooks class, … but before that, let's define a package called hooks. … Within the package, I'm going to define a new class, … and I'm going to call it RestaurantSystemHooks. … My class is created, … so let's go ahead and define two methods here. … First one, … public void BeforeDisplayMessage. … And let's define … another method here … called AfterDisplayMessage. … We're going to apply special annotations to these … so this will be @Before … and I'm going to import … the Before from cucumber.api.java … and not from JUnit. … Let's annotate the second method. … Once again, use cucumber.api.java. …
- 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.