Slav Kurochkin 

Software Engineer

EPIC Loan Systems
Behavior-driven development in Java using
Cucumber-JVM
Cucumber Overview
Part I
2
What is Cucumber?
3
Cucumber is BDD
tool
Cucumber is NOT just a plant
4
A single source of truth
Cucumber merges specification and test documentation into one cohesive whole.
Living documentation
Because they're automatically tested by Cucumber, your specifications are always
bang up-to-date.
Focus on the customer
Business and IT don't always understand each other. Cucumber's executable
specifications encourage closer collaboration, helping teams keep the business goal
in mind at all times.
Less rework
When automated testing is this much fun, teams can easily protect themselves from
costly regressions.
5
So how Cucumber
work?
Business and Technology work together
6
What is the main components of Cucumber and
how to make it grow fast?*
*There is no need for chemicals, just a bit of coding
7
- Feature files written in Gherkin (Given, When Then)
- Step Definitions glue plain english to code using
RegEx
- Configuration file, helping you configure testing
environment (setup, cleanup, outcome)
8
Feature file
• Tag - let us define execution
path

• Feature - name of the the
component we test 

• Description - short description
of what we are testing

• Background - common
behavior for all scenarios

• Scenario - individual test

• Gherkin - Scenario steps
(Given, When, Then)
9
Gherkin
• Given - defines initial state of
testing application

• When - action, invoke
methods, calling API,
interacting with UI layer

• Then - Asserting outcome

• And - helper if Given, When,
Then is not enough
10
Step Definition
• Sketching out the domain
model

• Annotations defines given,
when, then 

• RegEx to glue Feature file to
Java code(or whatever
language you use).
11
Configuration file
• Test setup

• Test cleanup

• Test outcome
12
Cucumber Technical Details
Part II
13
What can you test with Cucumber?
14
• DataBase Testing
• Unit or/and Component Testing
• API Testing using frameworks like RestAssured
• Web UI testing using Selenium WebDriver
15
Technical features of Cucumber
• Run specific tests (using tags)
• Rerun failed tests
• Parametrized tests (data driving tests)
• Reusable steps (steps showing up in predictive way)
• Detailed report (in case of UI testing we can add
screenshot on fail)
• Configurable test
16
Cucumber scenario states
• Failed - scenario failed
• Pending - step definition created but there is no code
implementation yet
• Undefined - there is Gherkin steps, but no step definition
• Skipped - if scenario failed theres is no need to waste
time and executing rest of the steps
• Passed - lucky you :)
17
Scenario vs Scenario Outline
18
Cucumber-JVM Test Runners
• JUnit
• CLI runners (Gradle, Maven, Ant etc)
• Android runner
• Third party runners
19
Test Code Examples
(can be found on github)
20
References
• https://cucumber.io/docs
• http://docs.behat.org
• https://relishapp.com
• http://specflow.org/documentation/
• https://www.ibm.com/developerworks/library/a-automating-ria/
• “The Cucumber For Java Book” by Seb Rose, Matt Wynne, & Aslak Helesoy
• “Specification by Example” by Gojko Adzic
• “BDD in Action” by John Ferguson Smart
• Rest-Assured with Cucumber: Using BDD for web services automation https://angiejones.tech/rest-
assured-with-cucumber-using-bdd-for-web-services-automation/ by Angie Jones
• toolsqa.com
21

More Related Content

PPT
Testing Any Site With Cucumber and Selenium
PPTX
Web automation in BDD
PPTX
BDD / cucumber /Capybara
PDF
Behavior Driven Development and Automation Testing Using Cucumber
PDF
Selenium Tips & Tricks - StarWest 2015
PDF
Implementing Testing for Behavior-Driven Development Using Cucumber
PDF
Selenium RC: Automated Testing of Modern Web Applications
PDF
Capybara testing
Testing Any Site With Cucumber and Selenium
Web automation in BDD
BDD / cucumber /Capybara
Behavior Driven Development and Automation Testing Using Cucumber
Selenium Tips & Tricks - StarWest 2015
Implementing Testing for Behavior-Driven Development Using Cucumber
Selenium RC: Automated Testing of Modern Web Applications
Capybara testing

What's hot (20)

PDF
APIs: A Better Alternative to Page Objects
PDF
Testing Code.org's Interactive CS Curriculum
PPTX
Spring Boot and REST API
PPTX
High Performance Snippets
PDF
Client Side Measurement & Performance With Rails
PDF
Front-End Testing: Demystified
PDF
Testing Web Applications
PDF
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
PPTX
Cache is King
PDF
How to Use Selenium, Successfully
PPT
Integration and Acceptance Testing
PPTX
Moving From a Selenium Grid to the Cloud - A Real Life Story
PDF
The LAZY Developer's Guide to BDD (with Cucumber)
PPTX
Testing Agile Web Services from soapUI
PDF
Testing nightwatch, by David Torroija
PPTX
Best Practices for creating WP REST API by Galkin Nikita
PDF
Crash Course in AngularJS + Ionic (Deep dive)
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
PDF
BlazeMeter Presents at the High Performance Drupal Meetup
PDF
Node.js and Selenium Webdriver, a journey from the Java side
APIs: A Better Alternative to Page Objects
Testing Code.org's Interactive CS Curriculum
Spring Boot and REST API
High Performance Snippets
Client Side Measurement & Performance With Rails
Front-End Testing: Demystified
Testing Web Applications
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
Cache is King
How to Use Selenium, Successfully
Integration and Acceptance Testing
Moving From a Selenium Grid to the Cloud - A Real Life Story
The LAZY Developer's Guide to BDD (with Cucumber)
Testing Agile Web Services from soapUI
Testing nightwatch, by David Torroija
Best Practices for creating WP REST API by Galkin Nikita
Crash Course in AngularJS + Ionic (Deep dive)
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
BlazeMeter Presents at the High Performance Drupal Meetup
Node.js and Selenium Webdriver, a journey from the Java side
Ad

Viewers also liked (20)

PDF
Page Objects Done Right - selenium conference 2014
PDF
How to Become a Thought Leader in Your Niche
PDF
Release Manager Data sheet
PDF
Apereo OAE development and release process
PPT
How To Plan a Software Project
PPTX
Release process for a project
PDF
Kudo codefest : Delivering High Quality Software Through Better Release Process
PPTX
Xen Project Release and Roadmap Process (4.7+)
PPTX
Release With Maven
PPTX
Agile Release Planning
PDF
IT Software - Release cycle & Delivery roadmap
PPTX
ITIL, Release Management and Automation
PDF
6 sigma LTE release management process improvement
PDF
10 Benefits of Automated Testing
PPT
Release Management
PPTX
Understanding the Agile Release and Sprint Planning Process
PPTX
Agile Testing by Example
PDF
Behavior Driven Development with Cucumber
PDF
Automation Testing using Selenium
PPT
Selenium ppt
Page Objects Done Right - selenium conference 2014
How to Become a Thought Leader in Your Niche
Release Manager Data sheet
Apereo OAE development and release process
How To Plan a Software Project
Release process for a project
Kudo codefest : Delivering High Quality Software Through Better Release Process
Xen Project Release and Roadmap Process (4.7+)
Release With Maven
Agile Release Planning
IT Software - Release cycle & Delivery roadmap
ITIL, Release Management and Automation
6 sigma LTE release management process improvement
10 Benefits of Automated Testing
Release Management
Understanding the Agile Release and Sprint Planning Process
Agile Testing by Example
Behavior Driven Development with Cucumber
Automation Testing using Selenium
Selenium ppt
Ad

Similar to BDD in Java using Cucumber (20)

PDF
Cucumber tutorial
PPTX
presentation.pptx
PDF
cucumber harpal.pdf
PDF
Selenium with Cucumber
PDF
Selenium with Cucumber
PDF
Selenium with Cucumber
PPTX
Automation test framework with cucumber – BDD
PPTX
BDD using Cucumber JVM
ODP
BDD with Cucumber
PDF
Advanced Test Automation: WDIO with BDD Cucumber
PPTX
BDD WITH CUCUMBER AND JAVA
PPTX
Test automation with Cucumber-JVM
PPTX
Testing with cucumber testing framework
PPTX
Presentation1.pptx
PDF
Mastering BDD with Cucumber & Java for Test Automation
PDF
Top 20 Cucumber interview questions and answers in 2023.pdf
PDF
Master Cucumber cheat sheet for testing .pdf
PDF
Cucumber ppt
PPTX
Bdd with Cucumber and Mocha
PPTX
Lets cook cucumber !!
Cucumber tutorial
presentation.pptx
cucumber harpal.pdf
Selenium with Cucumber
Selenium with Cucumber
Selenium with Cucumber
Automation test framework with cucumber – BDD
BDD using Cucumber JVM
BDD with Cucumber
Advanced Test Automation: WDIO with BDD Cucumber
BDD WITH CUCUMBER AND JAVA
Test automation with Cucumber-JVM
Testing with cucumber testing framework
Presentation1.pptx
Mastering BDD with Cucumber & Java for Test Automation
Top 20 Cucumber interview questions and answers in 2023.pdf
Master Cucumber cheat sheet for testing .pdf
Cucumber ppt
Bdd with Cucumber and Mocha
Lets cook cucumber !!

Recently uploaded (20)

PPTX
北安普顿大学毕业证UoN成绩单GPA修改北安普顿大学i20学历认证文凭
PDF
Toolkit of the MultiCloud DevOps Professional.pdf
PDF
ilide.info-huawei-odn-solution-introduction-pdf-pr_a17152ead66ea2617ffbd01e8c...
PPT
Expect The Impossiblesssssssssssssss.ppt
PDF
How Technology Shapes Our Information Age
PDF
Tailieuhoctiengnhat.com__(N5) 1021 từ vựng tổng hợp.pdf
PPTX
IOT LECTURE IOT LECTURE IOT LECTURE IOT LECTURE
PDF
AGENT SLOT TERPERCAYA INDONESIA – MAIN MUDAH, WD CEPAT, HANYA DI KANCA4D
PPTX
Introduction: Living in the IT ERA.pptx
PPTX
WEEK 15.pptx WEEK 15.pptx WEEK 15.pptx WEEK 15.pptx
PPTX
DAY 1 - Introduction to Git.pptxttttttttttttttttttttttttttttt
PPTX
IoT Lecture IoT Lecture IoT Lecture IoT Lecture
PDF
B450721.pdf American Journal of Multidisciplinary Research and Review
PPTX
Chapter 1_Overview hhhhhhhhhhhhhhhhhhhhhhhhhh
PPTX
FreePBX_Project_Presentation_With_Gantt.pptx
PPTX
PORTFOLIO SAMPLE…….………………………………. …pptx
DOCX
Audio to Video AI Technology Revolutiona
PPT
chapter 5: system unit computing essentials
PPTX
National-Historical-Commission-of-the-PhilippinesNHCP.pptx
PPTX
购买林肯大学毕业证|i20Lincoln成绩单GPA修改本科毕业证书购买学历认证
北安普顿大学毕业证UoN成绩单GPA修改北安普顿大学i20学历认证文凭
Toolkit of the MultiCloud DevOps Professional.pdf
ilide.info-huawei-odn-solution-introduction-pdf-pr_a17152ead66ea2617ffbd01e8c...
Expect The Impossiblesssssssssssssss.ppt
How Technology Shapes Our Information Age
Tailieuhoctiengnhat.com__(N5) 1021 từ vựng tổng hợp.pdf
IOT LECTURE IOT LECTURE IOT LECTURE IOT LECTURE
AGENT SLOT TERPERCAYA INDONESIA – MAIN MUDAH, WD CEPAT, HANYA DI KANCA4D
Introduction: Living in the IT ERA.pptx
WEEK 15.pptx WEEK 15.pptx WEEK 15.pptx WEEK 15.pptx
DAY 1 - Introduction to Git.pptxttttttttttttttttttttttttttttt
IoT Lecture IoT Lecture IoT Lecture IoT Lecture
B450721.pdf American Journal of Multidisciplinary Research and Review
Chapter 1_Overview hhhhhhhhhhhhhhhhhhhhhhhhhh
FreePBX_Project_Presentation_With_Gantt.pptx
PORTFOLIO SAMPLE…….………………………………. …pptx
Audio to Video AI Technology Revolutiona
chapter 5: system unit computing essentials
National-Historical-Commission-of-the-PhilippinesNHCP.pptx
购买林肯大学毕业证|i20Lincoln成绩单GPA修改本科毕业证书购买学历认证

BDD in Java using Cucumber

  • 1. Slav Kurochkin Software Engineer EPIC Loan Systems Behavior-driven development in Java using Cucumber-JVM
  • 4. Cucumber is BDD tool Cucumber is NOT just a plant 4
  • 5. A single source of truth Cucumber merges specification and test documentation into one cohesive whole. Living documentation Because they're automatically tested by Cucumber, your specifications are always bang up-to-date. Focus on the customer Business and IT don't always understand each other. Cucumber's executable specifications encourage closer collaboration, helping teams keep the business goal in mind at all times. Less rework When automated testing is this much fun, teams can easily protect themselves from costly regressions. 5
  • 6. So how Cucumber work? Business and Technology work together 6
  • 7. What is the main components of Cucumber and how to make it grow fast?* *There is no need for chemicals, just a bit of coding 7
  • 8. - Feature files written in Gherkin (Given, When Then) - Step Definitions glue plain english to code using RegEx - Configuration file, helping you configure testing environment (setup, cleanup, outcome) 8
  • 9. Feature file • Tag - let us define execution path • Feature - name of the the component we test • Description - short description of what we are testing • Background - common behavior for all scenarios • Scenario - individual test • Gherkin - Scenario steps (Given, When, Then) 9
  • 10. Gherkin • Given - defines initial state of testing application • When - action, invoke methods, calling API, interacting with UI layer • Then - Asserting outcome • And - helper if Given, When, Then is not enough 10
  • 11. Step Definition • Sketching out the domain model • Annotations defines given, when, then • RegEx to glue Feature file to Java code(or whatever language you use). 11
  • 12. Configuration file • Test setup • Test cleanup • Test outcome 12
  • 14. What can you test with Cucumber? 14
  • 15. • DataBase Testing • Unit or/and Component Testing • API Testing using frameworks like RestAssured • Web UI testing using Selenium WebDriver 15
  • 16. Technical features of Cucumber • Run specific tests (using tags) • Rerun failed tests • Parametrized tests (data driving tests) • Reusable steps (steps showing up in predictive way) • Detailed report (in case of UI testing we can add screenshot on fail) • Configurable test 16
  • 17. Cucumber scenario states • Failed - scenario failed • Pending - step definition created but there is no code implementation yet • Undefined - there is Gherkin steps, but no step definition • Skipped - if scenario failed theres is no need to waste time and executing rest of the steps • Passed - lucky you :) 17
  • 18. Scenario vs Scenario Outline 18
  • 19. Cucumber-JVM Test Runners • JUnit • CLI runners (Gradle, Maven, Ant etc) • Android runner • Third party runners 19
  • 20. Test Code Examples (can be found on github) 20
  • 21. References • https://cucumber.io/docs • http://docs.behat.org • https://relishapp.com • http://specflow.org/documentation/ • https://www.ibm.com/developerworks/library/a-automating-ria/ • “The Cucumber For Java Book” by Seb Rose, Matt Wynne, & Aslak Helesoy • “Specification by Example” by Gojko Adzic • “BDD in Action” by John Ferguson Smart • Rest-Assured with Cucumber: Using BDD for web services automation https://angiejones.tech/rest- assured-with-cucumber-using-bdd-for-web-services-automation/ by Angie Jones • toolsqa.com 21