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

Background: Execution flow

From the course: Cucumber Essential Training

Start my 1-month free trial

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…

Contents