SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
GHERKIN
ubiquitous language for automated acceptance testing
What’s Gherkin?
• an ubiquitous language for

developers and stakeholders
• aimed for automated 

acceptance tests
• it adheres to BDD
What’s BDD?
Behavior Driven Development
1
2
3
Why Gherkin?
• write executable specifications
• enforce a collaborative approach
• force a specification format
• serve as living documentation
The language
• support for multiple languages
• small set of keywords: 

Feature, Background, Scenario, 

Given, When, Then, And, But, *, 

Scenario Outline, Examples
Feature
• provide summary documentation
• one feature per file
• avoid long descriptions
Feature
Feature: feature title
In order to <meet some goal>
As a <type of stakeholder>
I want <a feature>
Scenario
• describes how system should
behave under a particular
situation
• follows a common pattern: 

context, action, outcome
Scenario
Scenario: Successful withdrawal from an account
Given I have $100 in my account
When I request $20
Then my balance should be $80
context
outcome(s)
action(s)
Scenario
Scenario: Attempt withdrawal using blocked PIN
Given i have $100 in my account
But my PIN is blocked
When i withdraw $50
Then my request should be refuted
And i am forced to reset my PIN
context
outcome(s)
action(s)
Capturing values
• values passed to code as
arguments
• string wrapped by double quotes
• all of the numbers
Scenario: Request a new card
Given I’ve lost my “Visa”
When I request a new card at the “ACME” desk
And I specify a limit of $ 5000 bucks
Then I should be asked for my account details
And I should be provided with a brand new card
Capturing values
Scenario tips
• must make sense to the “others”
• must be executed independently
• must be deterministic
DRY strategies
• share common context
• avoid repeating scenarios
• group similar data
• strength focus on key examples
Scenario: Change PIN successfully
Given I have been issued a new card
And I insert the card, entering the correct PIN
When I choose “Change PIN” from the menu
And I change the PIN to 9876
Then the system should remember my PIN is now 9876
Scenario: Try to change PIN to the same as before
Given I have been issued a new card
And I insert the card, entering the correct PIN
When I choose "Change PIN” from the menu
And I try to change the PIN to the original number
Then I should see a warning message
Background
Background: Insert a newly issued card and sign in
Given I have been issued a new card
And I insert the card, entering the correct PIN
And I choose “Change PIN” from the menu
Scenario: Change PIN successfully
When I change the PIN to 9876
Then the system should remember my PIN is now 9876
Scenario: Try to change PIN to the same as before
When I try to change the PIN to the original number
Then I should see a warning message
Background
Background
• only one per feature file
• short is better
• avoid setting complicated state
• stick with givens
Given a User “Michael Jackson” born on “August 29, 1958”
And a User “Elvis” born on “January 8, 1935”
And a User “John Lennon” born on “October 9, 1940”
Data tables
Given these Users:
| name | date of birth |
| Michael Jackson | August 29, 1958 |
| Elvis | January 8, 1935 |
| John Lennon | October 9, 1940 |
Formatting
spaces are
ignored
Data tables
Scenario: Withdraw fixed amount of $50
Given i have $500 in my account
When i withdraw the fixed amount of $50
Then i should receive $50 cash
And the balance of my account should be $450
Scenario: Withdraw fixed amount of $100
Given i have $500 in my account
When i withdraw the fixed amount of $100
Then i should receive $100 cash
And the balance of my account should be $400
Scenario Outline
Scenario Outline: Withdraw fixed amount
Given i have <balance> in my account
When i withdraw the fixed amount of <withdrawal>
Then i should receive <received> cash
And the balance of my account should be <remaining>
Examples:
| balance | withdrawal | received | remaining |
| $500 | $50 | $50 | $450 |
| $500 | $100 | $100 | $400 |
As many cases
as you need
Scenario Outline
Scenario Outline: Withdraw fixed amount
Given i have <balance> in my account
When i withdraw the fixed amount of <withdrawal>
Then i should <outcome>
And the balance of my account should be <remaining>
Examples: Successful withdrawal
| balance | withdrawal | outcome | remaining |
| $500 | $50 | receive $50 cash | $450 |
Examples: Attempt to withdraw too much
| balance | withdrawal | outcome | remaining |
| $100 | $200 | see an error message | $100 |
Key examples
Best practices
• fix flickering scenarios
• guard from brittle features
• speed up slow features
• avoid bored stakeholders
Incidental details
Scenario: Check inbox
Given a User “Dave” with password “password”
And a User “Sue” with password “secret”
And an email to “Dave” from “Sue”
When i sign in as “Dave” with password “password”
Then i should see 1 email from “Sue” in my inbox
Scenario: Check inbox
Given i have received an email from “Sue”
When i sign in
Then i should see 1 email from “Sue” in my inbox
Incidental details
Imperative VS declarative
Scenario: Redirect user to requested page after logging in
Given a User “dave” exists with password “secret”
And i am not logged in
When i navigate to the home page
Then i am redirected to the login form
When i fill in “Username” with “dave”
And i fill in “Password” with “secret”
And i press “Login”
Then i should be on the home page
Scenario: Redirect user to requested page after logging in
Given i am an unauthenticated User
When i attempt to view some restricted content
Then i am shown a login form
When i authenticate with valid credentials
Then i should be shown the restricted content
Imperative VS declarative
Who’s write Gherkin?
Tester
Developer
Product
Owner
ubiquitous language for automated acceptance testing
Questions?

Contenu connexe

Tendances

Kubernetes #2 monitoring
Kubernetes #2   monitoring Kubernetes #2   monitoring
Kubernetes #2 monitoring Terry Cho
 
WebAuthn and Security Keys
WebAuthn and Security KeysWebAuthn and Security Keys
WebAuthn and Security KeysFIDO Alliance
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with XtextHolger Schill
 
Property Based Testing in PHP
Property Based Testing in PHPProperty Based Testing in PHP
Property Based Testing in PHPvinaikopp
 
User authentication and authorizarion in Kubernetes
User authentication and authorizarion in KubernetesUser authentication and authorizarion in Kubernetes
User authentication and authorizarion in KubernetesNeependra Khare
 
ソフトウェア工学2023 02 上流工程
ソフトウェア工学2023 02 上流工程ソフトウェア工学2023 02 上流工程
ソフトウェア工学2023 02 上流工程Toru Tamaki
 
The Power of Composition
The Power of CompositionThe Power of Composition
The Power of CompositionScott Wlaschin
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency GotchasAlex Miller
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix itRafael Dohms
 
Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式
Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式
Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式Justin Lin
 
The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)Scott Wlaschin
 
Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)Scott Wlaschin
 
Functional Design Patterns (DevTernity 2018)
Functional Design Patterns (DevTernity 2018)Functional Design Patterns (DevTernity 2018)
Functional Design Patterns (DevTernity 2018)Scott Wlaschin
 
Verifiable Credentials_Kristina_Identiverse2022_vFIN.pdf
Verifiable Credentials_Kristina_Identiverse2022_vFIN.pdfVerifiable Credentials_Kristina_Identiverse2022_vFIN.pdf
Verifiable Credentials_Kristina_Identiverse2022_vFIN.pdfKristina Yasuda
 
Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...
Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...
Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...Cristian Mamani
 
Securing Single-Page Applications with OAuth 2.0
Securing Single-Page Applications with OAuth 2.0Securing Single-Page Applications with OAuth 2.0
Securing Single-Page Applications with OAuth 2.0Prabath Siriwardena
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key ManagementAnthony Ikeda
 
Apache 핵심 프로젝트 camel 엿보기
Apache 핵심 프로젝트 camel 엿보기Apache 핵심 프로젝트 camel 엿보기
Apache 핵심 프로젝트 camel 엿보기Hwang Sun Oh Kelly
 

Tendances (20)

Kubernetes #2 monitoring
Kubernetes #2   monitoring Kubernetes #2   monitoring
Kubernetes #2 monitoring
 
WebAuthn and Security Keys
WebAuthn and Security KeysWebAuthn and Security Keys
WebAuthn and Security Keys
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
 
Property Based Testing in PHP
Property Based Testing in PHPProperty Based Testing in PHP
Property Based Testing in PHP
 
User authentication and authorizarion in Kubernetes
User authentication and authorizarion in KubernetesUser authentication and authorizarion in Kubernetes
User authentication and authorizarion in Kubernetes
 
ソフトウェア工学2023 02 上流工程
ソフトウェア工学2023 02 上流工程ソフトウェア工学2023 02 上流工程
ソフトウェア工学2023 02 上流工程
 
The Power of Composition
The Power of CompositionThe Power of Composition
The Power of Composition
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix it
 
Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式
Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式
Servlet & JSP 教學手冊第二版 - 第 1 章:簡介Web應用程式
 
The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)
 
Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)
 
Drools et les moteurs de règles
Drools et les moteurs de règlesDrools et les moteurs de règles
Drools et les moteurs de règles
 
Functional Design Patterns (DevTernity 2018)
Functional Design Patterns (DevTernity 2018)Functional Design Patterns (DevTernity 2018)
Functional Design Patterns (DevTernity 2018)
 
Vault
VaultVault
Vault
 
Verifiable Credentials_Kristina_Identiverse2022_vFIN.pdf
Verifiable Credentials_Kristina_Identiverse2022_vFIN.pdfVerifiable Credentials_Kristina_Identiverse2022_vFIN.pdf
Verifiable Credentials_Kristina_Identiverse2022_vFIN.pdf
 
Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...
Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...
Keycloak - Tu guarura para dar seguridad a tus aplicaciones de Backend y Fron...
 
Securing Single-Page Applications with OAuth 2.0
Securing Single-Page Applications with OAuth 2.0Securing Single-Page Applications with OAuth 2.0
Securing Single-Page Applications with OAuth 2.0
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key Management
 
Apache 핵심 프로젝트 camel 엿보기
Apache 핵심 프로젝트 camel 엿보기Apache 핵심 프로젝트 camel 엿보기
Apache 핵심 프로젝트 camel 엿보기
 

En vedette

A New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingA New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingDr. Alexander Schwartz
 
BDD - beyond: Given, When and Then
BDD - beyond: Given, When and ThenBDD - beyond: Given, When and Then
BDD - beyond: Given, When and ThenRiverGlide
 
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...Scrum Bangalore
 
Tutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with GherkinTutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with GherkinChristian Hassa
 
Specification by example and agile acceptance testing
Specification by example and agile acceptance testingSpecification by example and agile acceptance testing
Specification by example and agile acceptance testinggojkoadzic
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with GherkinChristian Hassa
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bddPrince Gupta
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinQA or the Highway
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by ExampleDeclan Whelan
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)Usersnap
 

En vedette (11)

A New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingA New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story Splitting
 
BDD - beyond: Given, When and Then
BDD - beyond: Given, When and ThenBDD - beyond: Given, When and Then
BDD - beyond: Given, When and Then
 
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
 
Tutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with GherkinTutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with Gherkin
 
Specification by example and agile acceptance testing
Specification by example and agile acceptance testingSpecification by example and agile acceptance testing
Specification by example and agile acceptance testing
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with Gherkin
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bdd
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by Example
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)
 

Similaire à Gherkin - crash course

Perfecting the pitch with note slides
Perfecting the pitch with note slidesPerfecting the pitch with note slides
Perfecting the pitch with note slidesKen Berkun
 
Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)Adam Nash
 
Armstrong crowdfunding presentation public version
Armstrong crowdfunding presentation   public versionArmstrong crowdfunding presentation   public version
Armstrong crowdfunding presentation public versionCraig Armstrong
 
Personal Finance for Engineers
Personal Finance for EngineersPersonal Finance for Engineers
Personal Finance for EngineersAdam Nash
 
Pete Craig's Presentation
Pete Craig's PresentationPete Craig's Presentation
Pete Craig's Presentationpetewcraig
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examplesSeb Rose
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)Venkatesh Prasad Ranganath
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashNiels Frydenholm
 
Behavior-Driven Development for UX Teams
Behavior-Driven Development for UX TeamsBehavior-Driven Development for UX Teams
Behavior-Driven Development for UX TeamsJonathan Abbett
 

Similaire à Gherkin - crash course (12)

Perfecting the pitch with note slides
Perfecting the pitch with note slidesPerfecting the pitch with note slides
Perfecting the pitch with note slides
 
Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)
 
Armstrong crowdfunding presentation public version
Armstrong crowdfunding presentation   public versionArmstrong crowdfunding presentation   public version
Armstrong crowdfunding presentation public version
 
Personal Finance for Engineers
Personal Finance for EngineersPersonal Finance for Engineers
Personal Finance for Engineers
 
Pete Craig's Presentation
Pete Craig's PresentationPete Craig's Presentation
Pete Craig's Presentation
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
Message passing
Message passingMessage passing
Message passing
 
Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 
Behavior-Driven Development for UX Teams
Behavior-Driven Development for UX TeamsBehavior-Driven Development for UX Teams
Behavior-Driven Development for UX Teams
 
General Worldcat Ill Revised
General Worldcat Ill RevisedGeneral Worldcat Ill Revised
General Worldcat Ill Revised
 

Plus de Michele Costa (13)

SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
Ozonopatia
OzonopatiaOzonopatia
Ozonopatia
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...
Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...
Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...
 
Tariffario ANDI
Tariffario ANDITariffario ANDI
Tariffario ANDI
 

Dernier

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 

Dernier (20)

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

Gherkin - crash course

  • 1. GHERKIN ubiquitous language for automated acceptance testing
  • 2. What’s Gherkin? • an ubiquitous language for
 developers and stakeholders • aimed for automated 
 acceptance tests • it adheres to BDD
  • 3. What’s BDD? Behavior Driven Development 1 2 3
  • 4. Why Gherkin? • write executable specifications • enforce a collaborative approach • force a specification format • serve as living documentation
  • 5. The language • support for multiple languages • small set of keywords: 
 Feature, Background, Scenario, 
 Given, When, Then, And, But, *, 
 Scenario Outline, Examples
  • 6. Feature • provide summary documentation • one feature per file • avoid long descriptions
  • 7. Feature Feature: feature title In order to <meet some goal> As a <type of stakeholder> I want <a feature>
  • 8. Scenario • describes how system should behave under a particular situation • follows a common pattern: 
 context, action, outcome
  • 9. Scenario Scenario: Successful withdrawal from an account Given I have $100 in my account When I request $20 Then my balance should be $80 context outcome(s) action(s)
  • 10. Scenario Scenario: Attempt withdrawal using blocked PIN Given i have $100 in my account But my PIN is blocked When i withdraw $50 Then my request should be refuted And i am forced to reset my PIN context outcome(s) action(s)
  • 11. Capturing values • values passed to code as arguments • string wrapped by double quotes • all of the numbers
  • 12. Scenario: Request a new card Given I’ve lost my “Visa” When I request a new card at the “ACME” desk And I specify a limit of $ 5000 bucks Then I should be asked for my account details And I should be provided with a brand new card Capturing values
  • 13. Scenario tips • must make sense to the “others” • must be executed independently • must be deterministic
  • 14. DRY strategies • share common context • avoid repeating scenarios • group similar data • strength focus on key examples
  • 15. Scenario: Change PIN successfully Given I have been issued a new card And I insert the card, entering the correct PIN When I choose “Change PIN” from the menu And I change the PIN to 9876 Then the system should remember my PIN is now 9876 Scenario: Try to change PIN to the same as before Given I have been issued a new card And I insert the card, entering the correct PIN When I choose "Change PIN” from the menu And I try to change the PIN to the original number Then I should see a warning message Background
  • 16. Background: Insert a newly issued card and sign in Given I have been issued a new card And I insert the card, entering the correct PIN And I choose “Change PIN” from the menu Scenario: Change PIN successfully When I change the PIN to 9876 Then the system should remember my PIN is now 9876 Scenario: Try to change PIN to the same as before When I try to change the PIN to the original number Then I should see a warning message Background
  • 17. Background • only one per feature file • short is better • avoid setting complicated state • stick with givens
  • 18. Given a User “Michael Jackson” born on “August 29, 1958” And a User “Elvis” born on “January 8, 1935” And a User “John Lennon” born on “October 9, 1940” Data tables
  • 19. Given these Users: | name | date of birth | | Michael Jackson | August 29, 1958 | | Elvis | January 8, 1935 | | John Lennon | October 9, 1940 | Formatting spaces are ignored Data tables
  • 20. Scenario: Withdraw fixed amount of $50 Given i have $500 in my account When i withdraw the fixed amount of $50 Then i should receive $50 cash And the balance of my account should be $450 Scenario: Withdraw fixed amount of $100 Given i have $500 in my account When i withdraw the fixed amount of $100 Then i should receive $100 cash And the balance of my account should be $400 Scenario Outline
  • 21. Scenario Outline: Withdraw fixed amount Given i have <balance> in my account When i withdraw the fixed amount of <withdrawal> Then i should receive <received> cash And the balance of my account should be <remaining> Examples: | balance | withdrawal | received | remaining | | $500 | $50 | $50 | $450 | | $500 | $100 | $100 | $400 | As many cases as you need Scenario Outline
  • 22. Scenario Outline: Withdraw fixed amount Given i have <balance> in my account When i withdraw the fixed amount of <withdrawal> Then i should <outcome> And the balance of my account should be <remaining> Examples: Successful withdrawal | balance | withdrawal | outcome | remaining | | $500 | $50 | receive $50 cash | $450 | Examples: Attempt to withdraw too much | balance | withdrawal | outcome | remaining | | $100 | $200 | see an error message | $100 | Key examples
  • 23. Best practices • fix flickering scenarios • guard from brittle features • speed up slow features • avoid bored stakeholders
  • 24. Incidental details Scenario: Check inbox Given a User “Dave” with password “password” And a User “Sue” with password “secret” And an email to “Dave” from “Sue” When i sign in as “Dave” with password “password” Then i should see 1 email from “Sue” in my inbox
  • 25. Scenario: Check inbox Given i have received an email from “Sue” When i sign in Then i should see 1 email from “Sue” in my inbox Incidental details
  • 26. Imperative VS declarative Scenario: Redirect user to requested page after logging in Given a User “dave” exists with password “secret” And i am not logged in When i navigate to the home page Then i am redirected to the login form When i fill in “Username” with “dave” And i fill in “Password” with “secret” And i press “Login” Then i should be on the home page
  • 27. Scenario: Redirect user to requested page after logging in Given i am an unauthenticated User When i attempt to view some restricted content Then i am shown a login form When i authenticate with valid credentials Then i should be shown the restricted content Imperative VS declarative
  • 29. ubiquitous language for automated acceptance testing Questions?