Date post: | 16-Apr-2017 |
Category: |
Software |
Upload: | srinivas-katakam |
View: | 66 times |
Download: | 0 times |
Behaviour Driven Development using Cucumber and Java
Srinivas Katakam
Presented to JUG Hyderabad11-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 StoryAs 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 sourcetool 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???