Cucumber

Testing — Cucumber Way
@basics @introduction @start
Feature: Cucumber Basics
Read this article to know the basics of Cucumber

@start
Scenario: Beginner Start
Given I want to learn basics of Cucumber
And get idea about what is BDD all about
When I complete this article
And do some samples
Then I should be confident to work with Cucumber
And Explore more on the topic

Trivia — How did the name originate

Few key definitions and explanations

Sample Feature File

#Author: your.email@your.domain.com
#Keywords Summary :
#Feature: List of scenarios.
#Scenario: Business rule through list of steps with arguments.
#Given: Some precondition step
#When: Some key actions
#Then: To observe outcomes or validation
#And,But: To enumerate more Given,When,Then steps
#Scenario Outline: List of steps for data-driven as an Examples and <placeholder>
#Examples: Container for s table
#Background: List of steps run before each of the scenarios
#””” (Doc Strings)
#| (Data Tables)
#@ (Tags/Labels):To group Scenarios
#<> (placeholder)
#””
## (Comments)
#Sample Feature Definition Template
@tag
Feature: Title of your feature
I want to use this template for my feature file
@tag1
Scenario: Title of your scenario
Given I want to write a step with precondition
And some other precondition
When I complete action
And some other action
And yet another action
Then I validate the outcomes
And check more outcomes
@tag2
Scenario Outline: Title of your scenario outline
Given I want to write a step with <name>
When I check for the <value> in step
Then I verify the <status> in step
Examples:
| name | value | status |
| name1 | 5 | success |
| name2 | 7 | Fail |

FAQs

  1. Is Continuous Build possible in Cucumber
    The cucumber executable will exit with an exit status different from 0 if one or more scenarios are failing which can be picked up by CI Server. So, yes Cucumber supports continuous build and primary build tools like Ant/Maven
  2. Invalid CEN Header (Bad Signature) Error
    Usually when we build the maven project we can notice the error “Invalid CEN Header (Bad Signature)” along with “No backends were found. Please make sure you have a backend module on your CLASSPATH”. To resolve this delete the cucumber-java dependency or the jar file from the maven repository and rebuild the project. If this solution doesn't work then try to a use a different version of jar in pom dependencies.
  3. What are the basic tools/software needed to start with Cucumber
    Java, Maven and an IDE (Eclipse + Cucumber Plugin)
  4. Which is easy way to create Cucumber Project
    By using maven-plugin ‘cucumber-archetype’.
    Other way is to start with a POM file with basic cucumber dependencies like cucumber-java,cucumber-junit,junit and creating new Maven project
  5. How are Tags conditions considered
    Tags basically follow logical Boolean conditions and can be clubbed together.
@basics @introduction @end
Feature: Cucumber Basics
Read this article to know the basics of Cucumber

@end
Scenario: Beginner End
Given I have completed the article
When I apply this learning
And do some samples
Then I will share my experience in comments

--

--

--

Here to explore and learn

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Programming Tips For Developers

Generating Pixel Profile Pictures with Cellular Automata using Node.js and StdLib

Why You Should Never Consent to a Coding Test in an Interview

IP & internet infrastructure: a big picture

How to Use NAS Persistent Volumes Dynamically in a Kubernetes Cluster

RabbitMQ is a message broker

Embulk multiple filtering

Contributing factors for outstanding deliverables

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Deepak Kashyap

Deepak Kashyap

Here to explore and learn

More from Medium

Playwright Automation handling input boxes using type and fill methods

Microsoft Azure DevOps plugin for Android Studio

What test in a spring project and why