Cucumber with Java Tutorial and Framework

Cucumber with Java Tutorial and Framework.

Cucumber Framework Demo Video:

Below is a complete Cucumber tutorial and base framework kept on Git Hub at below location:

https://github.com/akashdktyagi/AutomationPoCCucumber

This framework is created for the new students of cucumber and provides a base cucumber eco-system skeleton upon which you can build your own requirements. It has few test cases already automated.

I plan to enhance it further to make it a full fledged automation Framework. Framework would have below features:

  • Maven for build and Configurations
  • Junit as runner
  • Cucumber
  • Selenium
  • Page object Model/Page Factory
  • Cucumber Reports for high level logs
  • Extent Reports for high level logs
  • Log4J for Logging and low level logs

Description: For full and updated code visit GitHub repo path mentioned at the top of this post.

Below is the sample code.

  1. How to Install it. Plugin and Dependencies
    1. Eclipse Market Place, search for Cucumber
    2. Or if there is an error in above step; try with Help->Install->new Software and follow the steps here: https://github.com/cucumber/cucumber-eclipse-update-site-snapshot
    3. Above steps is for Installing Cucumber Plugin in eclipse, it has nothing do with the execution of cucumber, it is just to feciliate easy development of cucumber FW in eclipse.
    4. To actually use cucumber you need below dependencies in your maven pom file.

    5.  
  2. Test Runner.java: To Execute the Cucumber use below class.For full and updated code visit GitHub repo path mentioned at the top of this post.

  3.  
  4. Feature Files: For full and updated code visit GitHub repo path mentioned at the top of this post.


    1.  
  5. Step Definitions Login: For full and updated code visit GitHub repo path mentioned at the top of this post.

    1. 2. Step Definition Register a new patient:For full and updated code visit GitHub repo path mentioned at the top of this post.


      1.  
  6. Page object model for login page: For full and updated code visit GitHub repo path mentioned at the top of this post.

    1.  
  7. Web Driver Manager: Driver has to be shared across different step definition class files. There can be multiple approaches. This framework uses concept of Singleton class for providing unique instance of Web Driver. Check below code:

    1.  

For full and latest code, check git hub link:

https://github.com/akashdktyagi/AutomationPoCCucumber