In this article we will automate the ticket booking scenario on SpiceJet website.
First of all, you need to create a maven project in eclipse or IntelliJ IDE then add all the cucumber, TestNG, and other dependencies in the pom.xml file.
Check dependencies here.
Then Follow these steps and create the required classes and feature files:-
In feature file we write the general english sentences using a Gerkins language. Gerkins has specific keywords like Given, When, Then, and And. We have to write sentences in english followed by these keywords as shown below. Now create the cucumber feature file and copy the below steps or write your own steps.
In this class we write the Java methods for the steps defined in above cucumber file. Each step will have one definition or Methods that's why we call it step definitions.
Create a step definitions for above steps in step definition package.
Hoping that you enjoyed reading this post and working on the project. Working on hands-on automation projects like this one is the best way to sharpen your skills.
I hope you have learned something new today.
Thanks for Reading !!!
anonymous | June 23, 2022, 10:32 p.m.
Really helpful 👍