SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Writing tests in a stylized way
@DrupalBangalore - Date 25 July 2015 www.srijan.net
Ravindra Singh
@ravindrasingh01
Scenario: Successfully authenticating with correct credentials
Given there is a user “everzet” with password “123”
And I am on the login page
When I fill in “username” with “everzet”
And I fill in “password” with “123”
And I press “login”
Then I should see “Hello, everzet”
In order to get access to the shopping history
As a frequent buyer I need to be able to authenticate
As a buyer I want to see the shopping history
Requirement:
Feature:
Dev Team
Client
Scenario: Successfully authenticating with correct credentials
Given there is a user “everzet” with password “123”
And I am on the login page
When I fill in “username” with “everzet”
And I fill in “password” with “123”
And I press “login”
Then I should see “Hello, everzet”
In order to get access to the shopping history
As a frequent buyer I need to be able to authenticate
As a buyer I want to see the shopping history
Requirement:
Feature:
Dev Team
Client
StoryBDD helps ensuring that development
team has understanding of business on the
same level that client does
Scenario: Successfully authenticating with correct credentials
Given there is a user “everzet” with password “123”
And I am on the login page
When I fill in “username” with “everzet”
And I fill in “password” with “123”
And I press “login”
Then I should see “Hello, everzet”
In order to get access to the shopping history
As a frequent buyer I need to be able to authenticate
As a buyer I want to see the shopping history
Requirement:
Feature:
Dev Team
Client
Agenda
● Introduction to Behat
● Behat Drupal Extension
● Behat Installation/Configuration
● Behat test execution from command line
● A real world example
● How to minimize regressing testing using Behat
What is Behat?
● Welcome to Behat! Behat is a tool that makes behavior
driven development(BDD) possible. With BDD, you write
human-readable stories that describe the behavior of your
application. These stories can then be auto-tested against
your application. And yes, it’s as cool as it sounds!
Drupal Extension
The Drupal Extension to Behat and Mink assists in the
performance of these common Drupal testing tasks:
● Set up test data with Drush or the Drupal API
● Define theme regions and test data appears within them
● Clear the cache, log out, and other useful steps
● Detect and discover steps provided by contributed
modules and themes
● Detail - https://www.drupal.org/project/drupalextension
Installation using Composer
1. Install Composer
2. Install the Drupal Extension in /opt/drupalextension
3. Create an alias to the behat binary in /usr/local/bin
4. Create your test folder
Installation using Composer
Installation using Composer
Installation using Composer
Setup tests
● Create a folder DCB15 where you want to store all test files
for specific projects.
● Create file behat.yml in DCB15
Dry Run
● To ensure everything is set up appropriately, type:
behat -dl
We
Are
Ready
Real world example
Feature: H1 Validations
In order to check H1
As visitor
I need to validate headings are in H1 tag
Scenario: Test the ability to find a heading in a
region
Given I go to "http://d8localdev.me/"
When I click "Create new account"
Then I should see the heading "Create new account"
in the "content" region
Regression Testing
Drupal API Driver
Drush Driver
More info - http://behat-drupal-extension.readthedocs.org/
References
More info - http://behat-drupal-extension.readthedocs.org/
http://behat-drupal-extension.readthedocs.org/
https://github.com/silverstripe-labs/silverstripe-behat-
extension
http://behat.readthedocs.org/en/v2.5/guides/1.gherkin.
html#scenario-outlines
https://www.youtube.com/watch?v=9cYhnTojaHU
http://2015.midcamp.org/session-proposal/automated-testing-
drupal-behat
@ravindrasingh01
Thank You!
Ravindra Singh (@ravindrasingh01)
https://www.drupal.org/u/ravindrasingh

Contenu connexe

Tendances

Plugging into plugins
Plugging into pluginsPlugging into plugins
Plugging into pluginsJosh Harrison
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Amanda Giles
 
Webinar: AngularJS and the WordPress REST API
Webinar: AngularJS and the WordPress REST APIWebinar: AngularJS and the WordPress REST API
Webinar: AngularJS and the WordPress REST APIWP Engine UK
 
Optimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficOptimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficWP Engine UK
 
Coder Presentation
Coder  PresentationCoder  Presentation
Coder PresentationDoug Green
 
Building a Simple Theme Framework
Building a Simple Theme FrameworkBuilding a Simple Theme Framework
Building a Simple Theme FrameworkJoe Casabona
 
Wp snapper review
Wp snapper reviewWp snapper review
Wp snapper reviewDilip Kumar
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web developmentAlberto Apellidos
 
Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Tudor Constantin
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015Daniel Kanchev
 
"Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp...
"Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp..."Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp...
"Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp...Sudeep Balchhaudi
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteDaniel Kanchev
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Developmentmwrather
 
WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)Tyler Sticka
 
Client-friendly WordPress Websites
Client-friendly WordPress WebsitesClient-friendly WordPress Websites
Client-friendly WordPress WebsitesAaron Rutley
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSSTodd Anglin
 

Tendances (20)

Plugging into plugins
Plugging into pluginsPlugging into plugins
Plugging into plugins
 
Automation Like A Pro
Automation Like A ProAutomation Like A Pro
Automation Like A Pro
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?
 
Webinar: AngularJS and the WordPress REST API
Webinar: AngularJS and the WordPress REST APIWebinar: AngularJS and the WordPress REST API
Webinar: AngularJS and the WordPress REST API
 
Optimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficOptimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday Traffic
 
Coder Presentation
Coder  PresentationCoder  Presentation
Coder Presentation
 
Building a Simple Theme Framework
Building a Simple Theme FrameworkBuilding a Simple Theme Framework
Building a Simple Theme Framework
 
Wp snapper review
Wp snapper reviewWp snapper review
Wp snapper review
 
Begin scripting
Begin scriptingBegin scripting
Begin scripting
 
Java script basic
Java script basicJava script basic
Java script basic
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web development
 
Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)Perl Behavior Driven Development (BDD)
Perl Behavior Driven Development (BDD)
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015
 
"Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp...
"Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp..."Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp...
"Ensuring chances of theme acceptance in wordpress.org directory" on WordCamp...
 
Wordpress Shortcode
Wordpress ShortcodeWordpress Shortcode
Wordpress Shortcode
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)
 
Client-friendly WordPress Websites
Client-friendly WordPress WebsitesClient-friendly WordPress Websites
Client-friendly WordPress Websites
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 

En vedette

Γνωρίστε το Drupal
Γνωρίστε το DrupalΓνωρίστε το Drupal
Γνωρίστε το DrupalDespina Kamilali
 
Η εξέλιξη του διδακτορικού μου
Η εξέλιξη του διδακτορικού μουΗ εξέλιξη του διδακτορικού μου
Η εξέλιξη του διδακτορικού μουDespina Kamilali
 
Drupal Developer Open Badge από το OpenEducation.GR
Drupal Developer Open Badge από το OpenEducation.GRDrupal Developer Open Badge από το OpenEducation.GR
Drupal Developer Open Badge από το OpenEducation.GRDespina Kamilali
 
Δημιουργία Ιστοσελίδων
Δημιουργία ΙστοσελίδωνΔημιουργία Ιστοσελίδων
Δημιουργία ΙστοσελίδωνDespina Kamilali
 
MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.
MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.
MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.Despina Kamilali
 
Custom Android App Development – Web Animation India
Custom Android App Development – Web Animation IndiaCustom Android App Development – Web Animation India
Custom Android App Development – Web Animation IndiaMarion Welch
 

En vedette (7)

Γνωρίστε το Drupal
Γνωρίστε το DrupalΓνωρίστε το Drupal
Γνωρίστε το Drupal
 
Η εξέλιξη του διδακτορικού μου
Η εξέλιξη του διδακτορικού μουΗ εξέλιξη του διδακτορικού μου
Η εξέλιξη του διδακτορικού μου
 
Drupal Developer Open Badge από το OpenEducation.GR
Drupal Developer Open Badge από το OpenEducation.GRDrupal Developer Open Badge από το OpenEducation.GR
Drupal Developer Open Badge από το OpenEducation.GR
 
Δημιουργία Ιστοσελίδων
Δημιουργία ΙστοσελίδωνΔημιουργία Ιστοσελίδων
Δημιουργία Ιστοσελίδων
 
MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.
MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.
MOOCs: Ιστορικά και Στατιστικά Στοιχεία - Διδακτικός σχεδιασμός.
 
SFA Sales Reporting Software for Key Performance Indicators
SFA Sales Reporting Software for Key Performance IndicatorsSFA Sales Reporting Software for Key Performance Indicators
SFA Sales Reporting Software for Key Performance Indicators
 
Custom Android App Development – Web Animation India
Custom Android App Development – Web Animation IndiaCustom Android App Development – Web Animation India
Custom Android App Development – Web Animation India
 

Similaire à Behat for writing tests in a stylized way

Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsKonstantin Kudryashov
 
Ruby onrails cucumber-rspec-capybara
Ruby onrails cucumber-rspec-capybaraRuby onrails cucumber-rspec-capybara
Ruby onrails cucumber-rspec-capybaraBindesh Vijayan
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Synerzip
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di piùDrupalDay
 
Behat - human-readable automated testing
Behat - human-readable automated testingBehat - human-readable automated testing
Behat - human-readable automated testingnyccamp
 
Panther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsersPanther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsersLes-Tilleuls.coop
 
BDD with CucumberJS and WebdriverIO
BDD with CucumberJS and WebdriverIOBDD with CucumberJS and WebdriverIO
BDD with CucumberJS and WebdriverIOM Rizwanur Rashid
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentEvan Mullins
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenarioArnauld Loyer
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressRami Sayar
 
TDD - for people who don't need it
TDD - for people who don't need itTDD - for people who don't need it
TDD - for people who don't need itChoon Keat Chew
 
Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014Barry Kooij
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesSauce Labs
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David TorroijaDavid Torroija
 

Similaire à Behat for writing tests in a stylized way (20)

Cucumber_Training_ForQA
Cucumber_Training_ForQACucumber_Training_ForQA
Cucumber_Training_ForQA
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
Ruby onrails cucumber-rspec-capybara
Ruby onrails cucumber-rspec-capybaraRuby onrails cucumber-rspec-capybara
Ruby onrails cucumber-rspec-capybara
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più
 
Behat - human-readable automated testing
Behat - human-readable automated testingBehat - human-readable automated testing
Behat - human-readable automated testing
 
Panther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsersPanther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsers
 
BDD with CucumberJS and WebdriverIO
BDD with CucumberJS and WebdriverIOBDD with CucumberJS and WebdriverIO
BDD with CucumberJS and WebdriverIO
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
Automation in Drupal
Automation in DrupalAutomation in Drupal
Automation in Drupal
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
 
TDD - for people who don't need it
TDD - for people who don't need itTDD - for people who don't need it
TDD - for people who don't need it
 
Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014Plugin Development @ WordCamp Norway 2014
Plugin Development @ WordCamp Norway 2014
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User Stories
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 

Dernier

cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabusViolet Violet
 
Test of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxTest of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxHome
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptxMUKULKUMAR210
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxLMW Machine Tool Division
 
Multicomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdfMulticomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdfGiovanaGhasary1
 
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecGuardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecTrupti Shiralkar, CISSP
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS Bahzad5
 
A Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software SimulationA Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software SimulationMohsinKhanA
 
Design of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxDesign of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxYogeshKumarKJMIT
 
Nodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxNodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxwendy cai
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Bahzad5
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesDIPIKA83
 
EPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxEPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxJoseeMusabyimana
 
solar wireless electric vechicle charging system
solar wireless electric vechicle charging systemsolar wireless electric vechicle charging system
solar wireless electric vechicle charging systemgokuldongala
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid BodyAhmadHajasad2
 

Dernier (20)

cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabus
 
Test of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxTest of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptx
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptx
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
 
Multicomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdfMulticomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdf
 
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecGuardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
 
A Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software SimulationA Seminar on Electric Vehicle Software Simulation
A Seminar on Electric Vehicle Software Simulation
 
Design of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxDesign of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptx
 
Nodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxNodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptx
 
Présentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdfPrésentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdf
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display Devices
 
Lecture 2 .pdf
Lecture 2                           .pdfLecture 2                           .pdf
Lecture 2 .pdf
 
Présentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdfPrésentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdf
 
Lecture 2 .pptx
Lecture 2                            .pptxLecture 2                            .pptx
Lecture 2 .pptx
 
Litature Review: Research Paper work for Engineering
Litature Review: Research Paper work for EngineeringLitature Review: Research Paper work for Engineering
Litature Review: Research Paper work for Engineering
 
EPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxEPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptx
 
solar wireless electric vechicle charging system
solar wireless electric vechicle charging systemsolar wireless electric vechicle charging system
solar wireless electric vechicle charging system
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
 

Behat for writing tests in a stylized way

  • 1. Writing tests in a stylized way @DrupalBangalore - Date 25 July 2015 www.srijan.net Ravindra Singh @ravindrasingh01
  • 2. Scenario: Successfully authenticating with correct credentials Given there is a user “everzet” with password “123” And I am on the login page When I fill in “username” with “everzet” And I fill in “password” with “123” And I press “login” Then I should see “Hello, everzet” In order to get access to the shopping history As a frequent buyer I need to be able to authenticate As a buyer I want to see the shopping history Requirement: Feature: Dev Team Client
  • 3. Scenario: Successfully authenticating with correct credentials Given there is a user “everzet” with password “123” And I am on the login page When I fill in “username” with “everzet” And I fill in “password” with “123” And I press “login” Then I should see “Hello, everzet” In order to get access to the shopping history As a frequent buyer I need to be able to authenticate As a buyer I want to see the shopping history Requirement: Feature: Dev Team Client StoryBDD helps ensuring that development team has understanding of business on the same level that client does
  • 4. Scenario: Successfully authenticating with correct credentials Given there is a user “everzet” with password “123” And I am on the login page When I fill in “username” with “everzet” And I fill in “password” with “123” And I press “login” Then I should see “Hello, everzet” In order to get access to the shopping history As a frequent buyer I need to be able to authenticate As a buyer I want to see the shopping history Requirement: Feature: Dev Team Client
  • 5. Agenda ● Introduction to Behat ● Behat Drupal Extension ● Behat Installation/Configuration ● Behat test execution from command line ● A real world example ● How to minimize regressing testing using Behat
  • 6. What is Behat? ● Welcome to Behat! Behat is a tool that makes behavior driven development(BDD) possible. With BDD, you write human-readable stories that describe the behavior of your application. These stories can then be auto-tested against your application. And yes, it’s as cool as it sounds!
  • 7. Drupal Extension The Drupal Extension to Behat and Mink assists in the performance of these common Drupal testing tasks: ● Set up test data with Drush or the Drupal API ● Define theme regions and test data appears within them ● Clear the cache, log out, and other useful steps ● Detect and discover steps provided by contributed modules and themes ● Detail - https://www.drupal.org/project/drupalextension
  • 8. Installation using Composer 1. Install Composer 2. Install the Drupal Extension in /opt/drupalextension 3. Create an alias to the behat binary in /usr/local/bin 4. Create your test folder
  • 12. Setup tests ● Create a folder DCB15 where you want to store all test files for specific projects. ● Create file behat.yml in DCB15
  • 13. Dry Run ● To ensure everything is set up appropriately, type: behat -dl
  • 15. Real world example Feature: H1 Validations In order to check H1 As visitor I need to validate headings are in H1 tag Scenario: Test the ability to find a heading in a region Given I go to "http://d8localdev.me/" When I click "Create new account" Then I should see the heading "Create new account" in the "content" region
  • 17. Drupal API Driver Drush Driver More info - http://behat-drupal-extension.readthedocs.org/
  • 18. References More info - http://behat-drupal-extension.readthedocs.org/ http://behat-drupal-extension.readthedocs.org/ https://github.com/silverstripe-labs/silverstripe-behat- extension http://behat.readthedocs.org/en/v2.5/guides/1.gherkin. html#scenario-outlines https://www.youtube.com/watch?v=9cYhnTojaHU http://2015.midcamp.org/session-proposal/automated-testing- drupal-behat
  • 19. @ravindrasingh01 Thank You! Ravindra Singh (@ravindrasingh01) https://www.drupal.org/u/ravindrasingh