Skip to main content

Cucumber Framework

Prerequisites

Chapters

Create Maven Project with Dependencies

  • Create a quick start maven project
  • Add compiler dependency
  • Add Cucumber and REST Assured maven dependencies

Build Cucumber Feature File

  • Create packages
    • feature
    • stepdefinitions
    • testrunner
  • Create a Feature File
  • Patameterize the API Name ex: Add Place API, Delete Place API

Create Step Definitions and Test Runner

  • Create Step Definitions
  • Create Interface do not use RESTAssured directly
  • Create a Test Runner class and configure it with annotations

Implement Step Definitions

  • Implement Step Definitions

Create Utility Class

  • Move the setup code into a Utility class
  • Reusable Request Spec and Response Spec should be placed inside this class

Logging Filters

  • Add filters
    • Request Logging Filter
    • Response Logging Filter

Property File

  • Add a global property file
  • Get the property values from Property File