Skip to main content

Posts

Showing posts with the label featurefile

BDD Series (4) — karate API testing. Hands-on!

Photo by  Jason Briscoe  on  Unsplash In our previous post  Anatomy of a feature fil e, we talked about the feature files, the Gherkin syntax, and Gherkin keywords. In this post, we will see a quick overview of Intuit Karate based on Gherkin. Karate DSL uses Gherkin syntax, If you’re new to Cucumber & Gherkin, I highly recommend reading the previous post to understand terminologies. Why Karate Cucumber , the flagship BDD framework, popularized the  programming language-neutral , behavioral test constructs, written in  human languages  using Gherkin.  The  human-language  test steps mentioned in the  feature file  are backed by programming-language-dependent  Step-Definition  files, that are processed by the Cucumber engine. In today's world, development teams often work on Headless systems, which are comprised of only the backend APIs .  The Gherkin steps to test such systems are fixed. Such as but not limite...

BDD Series (3) — Anatomy of a feature-file

In  previous post  we had an overview of the Cucumber, Gherkin & feature file. Now let's see how to write test cases in feature files using Gherkin. Anatomy of a feature-file All non-blank lines in a  feature file  have to start with a valid  Gherkin keyword.  Some of them we discussed in the previous post. Here is the description of the main Gherkin keywords. Feature: The first Keyword in feature-file must be  Feature,  it must be followed by   : After  Feature:  cucumber ignores all the text and lines for processing until a line starting with either  Scenario ,  Background,  or  Scenario Outline  keyword is found. All the text in between is used only for reporting purposes.  The first line is used as the feature name, and the remaining lines (if present) are used as feature descriptions. Scenario: Scenario keyword must also be followed by  :  .  Any text after  :  in this ...