SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
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?

Más contenido relacionado

La actualidad más candente

Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
도메인 주도 설계의 본질
도메인 주도 설계의 본질도메인 주도 설계의 본질
도메인 주도 설계의 본질Young-Ho Cho
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak Abhishek Koserwal
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)Rohit Bisht
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first stepsRenato Primavera
 
Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)Abhishek Koserwal
 
Keycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler WebinarKeycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler Webinarmarcuschristie
 
Introduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with JavaIntroduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with JavaJawad Khan
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 

La actualidad más candente (20)

Specification by example
Specification by exampleSpecification by example
Specification by example
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
도메인 주도 설계의 본질
도메인 주도 설계의 본질도메인 주도 설계의 본질
도메인 주도 설계의 본질
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
Desafio Rest API
Desafio Rest APIDesafio Rest API
Desafio Rest API
 
TDD and BDD and ATDD
TDD and BDD and ATDDTDD and BDD and ATDD
TDD and BDD and ATDD
 
Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)
 
Keycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler WebinarKeycloak for Science Gateways - SGCI Technology Sampler Webinar
Keycloak for Science Gateways - SGCI Technology Sampler Webinar
 
Introduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with JavaIntroduction to Behaviour Driven Development (BDD) and Cucumber with Java
Introduction to Behaviour Driven Development (BDD) and Cucumber with Java
 
BDD and Behave
BDD and BehaveBDD and Behave
BDD and Behave
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 

Destacado

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
 
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
 
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
 
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
 

Destacado (8)

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...
 
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
 
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
 
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)
 

Similar a 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
 
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
 

Similar a Gherkin - crash course (11)

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
 
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
 

Más 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
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Último (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
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...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
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-...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

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?