KEMBAR78
BDD WITH CUCUMBER AND JAVA | PPTX
Behaviour Driven Development using Cucumber and Java
Srinivas Katakam
Presented to JUG Hyderabad
11-February-2017
About the talk
• BDD in a Nutshell
• BDD format
• BDD with Cucumber
• Cucumber Stack and advantages
• Cucumber-JVM
• Using Cucumber and Java with IntelliJ
• Geb
• Demo
• Questions
BDD in a Nutshell
BDD is a process designed to
aid the management and the
delivery of software
development projects by
improving communication
between engineers and
business professionals.
In so doing, BDD ensures all
development projects remain
focused on delivering what the
business actually needs while
meeting all requirements of
the user.
BDD Format
User Story
As a [X]
I want [Y]
so that [Z]
Scenario
Given some initial
context (the givens),
When an event
occurs,
then ensure some
outcomes.
BDD with Cucumber
• Cucumber is an open source
tool that is used to support
Behaviour Driven Development
with plain text specifications
• Implementations of
Cucumber exist for number
of platforms, including Java
Cucumber Stack and advantages
A single source of truth
• Cucumber merges specification and
test documentation into one cohesive
whole
Focus on the customer
• Cucumber's executable specifications
encourage closer collaboration,
helping teams keep the business goal
in mind at all times
Less rework
• Protect teams from costly regressions
Cucumber Stack
Cucumber-JVM
Cucumber-JVM is a
Cucumber
implementation for the
most popular JVM
languages
Running Cucumber
• JUnit Runner
• CLI Runner
• Android Runner
• Third party runners
Using Cucumber and Java with IntelliJ
New Maven Project
Add the pom.xml repository and dependencies
Add source folder, “src/test/resources”
Delete the App.java and AppTests.java files
Add the CukesRunner class
Settings -> Plugins -> Search for “Cucumber for Java” and install
Add the feature file and step class
Geb
GEB is a Web automation framework using groovy
It is a wrapper over selenium and provides a lot of inbuilt utilities that
will allow the end user to jump into the job of automating their
testcases and validating their application within a short period
Geb provides a enhanced Page Object modelling to its users with the
advantage of reusability and maintainability of tests and framework
Questions???

BDD WITH CUCUMBER AND JAVA

  • 1.
    Behaviour Driven Developmentusing Cucumber and Java Srinivas Katakam Presented to JUG Hyderabad 11-February-2017
  • 2.
    About the talk •BDD in a Nutshell • BDD format • BDD with Cucumber • Cucumber Stack and advantages • Cucumber-JVM • Using Cucumber and Java with IntelliJ • Geb • Demo • Questions
  • 3.
    BDD in aNutshell BDD is a process designed to aid the management and the delivery of software development projects by improving communication between engineers and business professionals. In so doing, BDD ensures all development projects remain focused on delivering what the business actually needs while meeting all requirements of the user.
  • 4.
    BDD Format User Story Asa [X] I want [Y] so that [Z] Scenario Given some initial context (the givens), When an event occurs, then ensure some outcomes.
  • 5.
    BDD with Cucumber •Cucumber is an open source tool that is used to support Behaviour Driven Development with plain text specifications • Implementations of Cucumber exist for number of platforms, including Java
  • 6.
    Cucumber Stack andadvantages A single source of truth • Cucumber merges specification and test documentation into one cohesive whole Focus on the customer • Cucumber's executable specifications encourage closer collaboration, helping teams keep the business goal in mind at all times Less rework • Protect teams from costly regressions Cucumber Stack
  • 7.
    Cucumber-JVM Cucumber-JVM is a Cucumber implementationfor the most popular JVM languages Running Cucumber • JUnit Runner • CLI Runner • Android Runner • Third party runners
  • 8.
    Using Cucumber andJava with IntelliJ New Maven Project Add the pom.xml repository and dependencies Add source folder, “src/test/resources” Delete the App.java and AppTests.java files Add the CukesRunner class Settings -> Plugins -> Search for “Cucumber for Java” and install Add the feature file and step class
  • 9.
    Geb GEB is aWeb automation framework using groovy It is a wrapper over selenium and provides a lot of inbuilt utilities that will allow the end user to jump into the job of automating their testcases and validating their application within a short period Geb provides a enhanced Page Object modelling to its users with the advantage of reusability and maintainability of tests and framework
  • 10.