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.
Background: Execution flow
- [Instructor] So this is my feature file and I want to see an error message because it's a duplicate item. So I'm going to go ahead and run my test runner and it should give me the method stub for the missing method. And it does. I'm just going to copy this method and paste it to our menu management steps and I'll supply incrementation to this method that reads assertEquals Duplicate Item, comparing this with ErrorMessage. So I'm using assertion framework here to compare the outputs, comparing what is returned from that exception error with my own error message which is Duplicate Item. So let me go ahead and re-run this test. And my test is successful. I got three scenarios and 18 steps. I'd like to point out another key concept with how step definition files are instantiated. So a step definition file is instantiated with each scenario, so it's instantiated before each scenario is run and in our case, since we have three scenarios in total, it should get instantiated thrice. To see…
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)
Cucumber tags: Add a tag4m 50s
-
(Locked)
Cucumber tags: Multiple tags2m 24s
-
(Locked)
Cucumber tags: Maven test with tags1m 39s
-
(Locked)
Background: Add background2m 26s
-
(Locked)
Background: Duplicate item2m 49s
-
(Locked)
Background: Execution flow2m 53s
-
(Locked)
Cucumber hooks: Adding hooks4m 30s
-
(Locked)
Cucumber hooks: Tagged hooks1m 49s
-
(Locked)
Cucumber reports: Generate reports3m 8s
-
(Locked)
Use monochrome and dryRun parameters3m 37s
-
(Locked)
-
-
-
-