SlideShare a Scribd company logo
Automation in Drupal 
by Bozhidar Boshnakov
About me 
• Bozhidar Boshnakov 
• Team leader @ ProPeople 
• bboshnakov91@gmail.com 
• Skype: bo6nakov 
• Drupal.org – bboshnakov 
• linkedin.com/in/bboshnakov
Table of contents 
• TDD – Test-Driven Development 
• BDD – Behavior-Driven Development 
• Gherkin 
• Behat 
• Mink 
• Drupal extension 
• Acceptance criteria 
• Demonstrations and show cases
INTELLIGENCE 
IS 
A LIABILITY!
SMART PEOPLE 
Can make progress … 
… without process 
This is not a good thing !!!
Professionals 
• Design, plan and prepare first 
• …then do the work 
• This produces better results FASTER !!!
Process is the difference 
between 
Software 
Engineering &Programming
In order to verify application behavior 
As a software developer 
I need tests 
Preferably automated tests
Test-Driven Development 
…is an iterative design process 
• Write a test 
• Ensure the new test fails 
• Write code to satisfy the test 
• Ensure all tests pass 
• Refactor 
• Repeat
Behavior-Driven Development 
…builds upon TDD 
• Write test cases in a natural language 
– Understood by developers and business folks alike 
– Helps relate domain language of requirements to 
the code 
• Do this with user stories and scenarios 
– User stories describe a feature’s benefit in context 
– Scenarios are executable acceptance criteria
Gherkin 
Gherkin is a Business Readable, Domain 
Specific Language created especially for 
behavior descriptions. It gives you the 
ability to remove logic details from 
behavior tests.
Gherkin Syntax
Gherkin Syntax 
Feature: Banana Calculator 
As Bob the Banana merchant, 
I want a calculator that can add the amount of 
bananas so that I can know how many bananas I 
currently have 
Scenario: Will add 2 banana amounts 
Given I have 3 Bananas 
When I add 5 Bananas 
Then I should have 8 Banana
This is where 
and come in
Behat is an open source behavior-driven 
development framework for 
PHP 5.3 and 5.4.
Before you begin, ensure that you have at least PHP 5.3.1 installed. 
The simplest way to 
install Behat is through 
Composer.
Composer.json 
{ 
"require": { 
"behat/mink": "*", 
"behat/mink-goutte-driver": "*", 
"behat/behat": "*", 
"behat/mink-extension": "*", 
"drupal/drupal-extension": "*" 
}, 
"minimum-stability": "dev", 
"config": { 
"bin-dir": "bin/" 
} 
}
Composer.phar 
Then download composer.phar and run install 
command: 
$ curl http://getcomposer.org/installer | php 
$ php composer.phar install
Behat.yml 
default: 
extensions: 
BehatMinkExtensionExtension: 
base_url: http://wearepropeople.com 
goutte: ~ 
selenium2: ~ 
paths: 
features: features 
bootstrap: features/bootstrap
And the last step… 
php bin/behat --init 
And now you have your Features folder 
where you can create the magic!!!
What are the features?
Let's Have Behat Analyze Our Feature
Behat Creates the Glue 
...but the rest is up to you
Not so fast. What about Mink?
Understanding Mink 
One of the most important parts in the 
web is a browser. A browser is the window 
through which web application users 
interact with the application and other 
users.
Headless 
browser 
emulators VS Browser 
controllers
Selenium2Driver 
• Control the Browser – Session 
• Cookies and Headers management 
• HTTP Authentication 
• Traverse the Page - Selectors 
• Manipulate the Page
Mink Context Defines Steps 
...for making requests
Mink Context Defines Steps 
...for interacting with forms
Mink Context Defines Steps 
...for querying the DOM
Mink Context Defines Steps 
...for examining responses
Now… 
Let’s get away from the 
theory and show some 
action!
Tags 
Tags are a great way to organize your 
features and scenarios: 
A Scenario or Feature can have as many 
tags as you like, just separate them with 
spaces:
Tags 
How to execute the tags? 
If a tag exists on a Feature, Behat 
will assign that tag to all child 
Scenarios and Scenario Outlines 
too!
Behat.yml 
All configuration happens inside a 
single configuration file in the 
YAML format.
Imports 
…or share your feature configurations
Profiles 
$bin/behat –p google features/feature1
The Drupal extension 
• Overrides default behaviors: 
– Snippets follow Drupal coding standards 
– Mink Extension steps get synonyms for readability 
• Provides drivers to facilitate data setup 
– Blackbox 
– Drush 
– Drupal API 
• Adds support for Drupal: 
– Regions 
– Node types 
– Users and Roles 
– Taxonomy 
– Subcontexts for Contributed Modules
Provides drivers for data set up 
• Works with Drupal 6, 7, and 8 
• Connect with no privileges (local or remote) 
• Connect with Drush (local or remote) 
• Connect with the Drupal API (local only)
About data setup 
• Every scenario must be able to run 
independent of other scenarios 
• Often work with a fresh copy of the 
production database 
• Can’t always assume the database has specific 
content 
• Separate architectural elements from content 
elements 
• Insert data to get reliable checks
Drush: alias file 
http://drush.ws/examples/example.aliases.drushrc.php
Drush: behat.yml
Drupal API: behat.yml
Region map: behat.yml
Regions 
Requires a map in the behat.yml file 
• label => css selector 
• This means regions don’t have to map directly to 
Drupal theme regions
Structure > Blocks > (Theme) > Demonstrate block regions
Nodes
Users, roles and taxonomies
Relational data
Relational data
If you have any questions or you want 
access for the full installation guideline feel 
free to contact me on my email address: 
bboshnakov91@gmail.com
Special thanks to: 
• Nikolay Ignatov 
• Boyan Borisov 
• Miroslav Banov 
• Toni Kolev
Resources 
• http://dspeak.com/pnwds/6-drupalextension.html 
• http://docs.behat.org/guides/7.config.html 
• http://behat.org/ 
• http://mink.behat.org/
Thank you!!!
Automation in Drupal

More Related Content

What's hot

Front End Web Development Basics
Front End Web Development BasicsFront End Web Development Basics
Front End Web Development Basics
Tahir Shahzad
 
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens  SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
Sencha
 
Web scraping 101 with goutte
Web scraping 101 with goutteWeb scraping 101 with goutte
Web scraping 101 with goutte
Joshua Copeland
 
Introducing MongoBase
Introducing MongoBaseIntroducing MongoBase
Introducing MongoBase
r1dotmy
 
Setting up your development environment
Setting up your development environmentSetting up your development environment
Setting up your development environment
Nicole Ryan
 
Geb with spock
Geb with spockGeb with spock
Geb with spock
Monika Gurram
 
Presentation on php and Javascript
Presentation on php and JavascriptPresentation on php and Javascript
Presentation on php and Javascript
Pradip Shrestha
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overview
Diacode
 
Why Drupal?
Why Drupal?Why Drupal?
Why Drupal?
Grossum
 
Cucumber
CucumberCucumber
Cucumber
CucumberCucumber
Cucumber
Bachue Zhou
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
Speedment, Inc.
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django IntroductionGanga Ram
 
Keystone.js 101
Keystone.js 101Keystone.js 101
Keystone.js 101
Alexander Roche
 
Multi-mania: Hacking your way through website issues with F12 devtools
Multi-mania: Hacking your way through website issues with F12 devtoolsMulti-mania: Hacking your way through website issues with F12 devtools
Multi-mania: Hacking your way through website issues with F12 devtools
Katrien De Graeve
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 Presentation
Eric Landmann
 
Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1
Katherine McCurdy-Lapierre, R.G.D.
 
Run around Chrome Inspector
Run around Chrome Inspector Run around Chrome Inspector
Run around Chrome Inspector
Tiang Cheng
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box
Suzanne Dergacheva
 

What's hot (20)

Front End Web Development Basics
Front End Web Development BasicsFront End Web Development Basics
Front End Web Development Basics
 
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens  SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
 
Web scraping 101 with goutte
Web scraping 101 with goutteWeb scraping 101 with goutte
Web scraping 101 with goutte
 
Introducing MongoBase
Introducing MongoBaseIntroducing MongoBase
Introducing MongoBase
 
Setting up your development environment
Setting up your development environmentSetting up your development environment
Setting up your development environment
 
Geb with spock
Geb with spockGeb with spock
Geb with spock
 
Presentation on php and Javascript
Presentation on php and JavascriptPresentation on php and Javascript
Presentation on php and Javascript
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overview
 
Why Drupal?
Why Drupal?Why Drupal?
Why Drupal?
 
Cucumber
CucumberCucumber
Cucumber
 
Cucumber
CucumberCucumber
Cucumber
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django Introduction
 
Keystone.js 101
Keystone.js 101Keystone.js 101
Keystone.js 101
 
Multi-mania: Hacking your way through website issues with F12 devtools
Multi-mania: Hacking your way through website issues with F12 devtoolsMulti-mania: Hacking your way through website issues with F12 devtools
Multi-mania: Hacking your way through website issues with F12 devtools
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 Presentation
 
Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1
 
Run around Chrome Inspector
Run around Chrome Inspector Run around Chrome Inspector
Run around Chrome Inspector
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box
 

Viewers also liked

DEV Project
DEV ProjectDEV Project
DEV Project
LuciusAtkinson
 
CLIENTES DE ROQUE - BOEDO.
CLIENTES DE ROQUE - BOEDO.CLIENTES DE ROQUE - BOEDO.
CLIENTES DE ROQUE - BOEDO.
Melina Campusano
 
Introduction in php
Introduction in phpIntroduction in php
Introduction in php
Bozhidar Boshnakov
 
Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)
Bozhidar Boshnakov
 
Tema engleza
Tema englezaTema engleza
Tema engleza
AdamCristian25
 
Как да направим живота си по - лесен с добър QA подход
Как да направим живота си по - лесен с добър QA подходКак да направим живота си по - лесен с добър QA подход
Как да направим живота си по - лесен с добър QA подход
Bozhidar Boshnakov
 
DrupalCamp Sofia 2015
DrupalCamp Sofia 2015DrupalCamp Sofia 2015
DrupalCamp Sofia 2015
Bozhidar Boshnakov
 
Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02
Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02
Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02
Lucky Lucky
 
Introduction in php part 2
Introduction in php part 2Introduction in php part 2
Introduction in php part 2
Bozhidar Boshnakov
 
عرض الفصل الثامن
عرض الفصل الثامنعرض الفصل الثامن
عرض الفصل الثامن
reemalahmari
 
PMG Gabrovo - Web Development Level 0 - Introduction
PMG Gabrovo - Web Development Level 0 - IntroductionPMG Gabrovo - Web Development Level 0 - Introduction
PMG Gabrovo - Web Development Level 0 - Introduction
Bozhidar Boshnakov
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
Bozhidar Boshnakov
 
¿Qué es la Ecología?
¿Qué es la Ecología?¿Qué es la Ecología?
¿Qué es la Ecología?
Joshua Arguello Paredes
 
Tema engleza
Tema englezaTema engleza
Tema engleza
AdamCristian25
 
QA Challange Accepted - How and why we should use Behat?
QA Challange Accepted - How and why we should use Behat?QA Challange Accepted - How and why we should use Behat?
QA Challange Accepted - How and why we should use Behat?
Bozhidar Boshnakov
 
Web fundamentals 2
Web fundamentals 2Web fundamentals 2
Web fundamentals 2
Bozhidar Boshnakov
 
Web fundamentals - part 1
Web fundamentals - part 1Web fundamentals - part 1
Web fundamentals - part 1
Bozhidar Boshnakov
 
تطوير أهداف التعليم العامة والخاصة
تطوير أهداف التعليم العامة والخاصةتطوير أهداف التعليم العامة والخاصة
تطوير أهداف التعليم العامة والخاصة
reemalahmari
 

Viewers also liked (19)

DEV Project
DEV ProjectDEV Project
DEV Project
 
CLIENTES DE ROQUE - BOEDO.
CLIENTES DE ROQUE - BOEDO.CLIENTES DE ROQUE - BOEDO.
CLIENTES DE ROQUE - BOEDO.
 
Introduction in php
Introduction in phpIntroduction in php
Introduction in php
 
Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)Object-Oriented Programming with PHP (part 1)
Object-Oriented Programming with PHP (part 1)
 
Tema engleza
Tema englezaTema engleza
Tema engleza
 
Как да направим живота си по - лесен с добър QA подход
Как да направим живота си по - лесен с добър QA подходКак да направим живота си по - лесен с добър QA подход
Как да направим живота си по - лесен с добър QA подход
 
DrupalCamp Sofia 2015
DrupalCamp Sofia 2015DrupalCamp Sofia 2015
DrupalCamp Sofia 2015
 
Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02
Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02
Nationalgeographictravelerphotooftheday2014 140831031457-phpapp02
 
Grammar simple past
Grammar simple pastGrammar simple past
Grammar simple past
 
Introduction in php part 2
Introduction in php part 2Introduction in php part 2
Introduction in php part 2
 
عرض الفصل الثامن
عرض الفصل الثامنعرض الفصل الثامن
عرض الفصل الثامن
 
PMG Gabrovo - Web Development Level 0 - Introduction
PMG Gabrovo - Web Development Level 0 - IntroductionPMG Gabrovo - Web Development Level 0 - Introduction
PMG Gabrovo - Web Development Level 0 - Introduction
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
¿Qué es la Ecología?
¿Qué es la Ecología?¿Qué es la Ecología?
¿Qué es la Ecología?
 
Tema engleza
Tema englezaTema engleza
Tema engleza
 
QA Challange Accepted - How and why we should use Behat?
QA Challange Accepted - How and why we should use Behat?QA Challange Accepted - How and why we should use Behat?
QA Challange Accepted - How and why we should use Behat?
 
Web fundamentals 2
Web fundamentals 2Web fundamentals 2
Web fundamentals 2
 
Web fundamentals - part 1
Web fundamentals - part 1Web fundamentals - part 1
Web fundamentals - part 1
 
تطوير أهداف التعليم العامة والخاصة
تطوير أهداف التعليم العامة والخاصةتطوير أهداف التعليم العامة والخاصة
تطوير أهداف التعليم العامة والخاصة
 

Similar to Automation in Drupal

Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
Marcos Labad
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your WebsiteAcquia
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
Bruno Capuano
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupal
Oscar Merida
 
Web Tools for GemStone/S
Web Tools for GemStone/SWeb Tools for GemStone/S
Web Tools for GemStone/S
ESUG
 
Learn from my Mistakes - Building Better Solutions in SPFx
Learn from my  Mistakes - Building Better Solutions in SPFxLearn from my  Mistakes - Building Better Solutions in SPFx
Learn from my Mistakes - Building Better Solutions in SPFx
Thomas Daly
 
Front end for back end developers
Front end for back end developersFront end for back end developers
Front end for back end developers
Wojciech Bednarski
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
Achievers Tech
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
edm00se
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer Night
Optimizely
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
fantabulous2024
 
[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
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPages
Ulrich Krause
 
Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)
Klas Berlič Fras
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
reedmaniac
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
Cesar Martinez
 

Similar to Automation in Drupal (20)

Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupal
 
Web Tools for GemStone/S
Web Tools for GemStone/SWeb Tools for GemStone/S
Web Tools for GemStone/S
 
Learn from my Mistakes - Building Better Solutions in SPFx
Learn from my  Mistakes - Building Better Solutions in SPFxLearn from my  Mistakes - Building Better Solutions in SPFx
Learn from my Mistakes - Building Better Solutions in SPFx
 
Front end for back end developers
Front end for back end developersFront end for back end developers
Front end for back end developers
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer Night
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
[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ù
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPages
 
Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
 

Recently uploaded

Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 

Recently uploaded (20)

Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 

Automation in Drupal

  • 1. Automation in Drupal by Bozhidar Boshnakov
  • 2. About me • Bozhidar Boshnakov • Team leader @ ProPeople • bboshnakov91@gmail.com • Skype: bo6nakov • Drupal.org – bboshnakov • linkedin.com/in/bboshnakov
  • 3. Table of contents • TDD – Test-Driven Development • BDD – Behavior-Driven Development • Gherkin • Behat • Mink • Drupal extension • Acceptance criteria • Demonstrations and show cases
  • 4. INTELLIGENCE IS A LIABILITY!
  • 5. SMART PEOPLE Can make progress … … without process This is not a good thing !!!
  • 6. Professionals • Design, plan and prepare first • …then do the work • This produces better results FASTER !!!
  • 7. Process is the difference between Software Engineering &Programming
  • 8. In order to verify application behavior As a software developer I need tests Preferably automated tests
  • 9. Test-Driven Development …is an iterative design process • Write a test • Ensure the new test fails • Write code to satisfy the test • Ensure all tests pass • Refactor • Repeat
  • 10. Behavior-Driven Development …builds upon TDD • Write test cases in a natural language – Understood by developers and business folks alike – Helps relate domain language of requirements to the code • Do this with user stories and scenarios – User stories describe a feature’s benefit in context – Scenarios are executable acceptance criteria
  • 11. Gherkin Gherkin is a Business Readable, Domain Specific Language created especially for behavior descriptions. It gives you the ability to remove logic details from behavior tests.
  • 13. Gherkin Syntax Feature: Banana Calculator As Bob the Banana merchant, I want a calculator that can add the amount of bananas so that I can know how many bananas I currently have Scenario: Will add 2 banana amounts Given I have 3 Bananas When I add 5 Bananas Then I should have 8 Banana
  • 14.
  • 15. This is where and come in
  • 16. Behat is an open source behavior-driven development framework for PHP 5.3 and 5.4.
  • 17. Before you begin, ensure that you have at least PHP 5.3.1 installed. The simplest way to install Behat is through Composer.
  • 18. Composer.json { "require": { "behat/mink": "*", "behat/mink-goutte-driver": "*", "behat/behat": "*", "behat/mink-extension": "*", "drupal/drupal-extension": "*" }, "minimum-stability": "dev", "config": { "bin-dir": "bin/" } }
  • 19. Composer.phar Then download composer.phar and run install command: $ curl http://getcomposer.org/installer | php $ php composer.phar install
  • 20. Behat.yml default: extensions: BehatMinkExtensionExtension: base_url: http://wearepropeople.com goutte: ~ selenium2: ~ paths: features: features bootstrap: features/bootstrap
  • 21. And the last step… php bin/behat --init And now you have your Features folder where you can create the magic!!!
  • 22. What are the features?
  • 23. Let's Have Behat Analyze Our Feature
  • 24. Behat Creates the Glue ...but the rest is up to you
  • 25. Not so fast. What about Mink?
  • 26. Understanding Mink One of the most important parts in the web is a browser. A browser is the window through which web application users interact with the application and other users.
  • 27. Headless browser emulators VS Browser controllers
  • 28. Selenium2Driver • Control the Browser – Session • Cookies and Headers management • HTTP Authentication • Traverse the Page - Selectors • Manipulate the Page
  • 29. Mink Context Defines Steps ...for making requests
  • 30. Mink Context Defines Steps ...for interacting with forms
  • 31. Mink Context Defines Steps ...for querying the DOM
  • 32. Mink Context Defines Steps ...for examining responses
  • 33. Now… Let’s get away from the theory and show some action!
  • 34. Tags Tags are a great way to organize your features and scenarios: A Scenario or Feature can have as many tags as you like, just separate them with spaces:
  • 35. Tags How to execute the tags? If a tag exists on a Feature, Behat will assign that tag to all child Scenarios and Scenario Outlines too!
  • 36. Behat.yml All configuration happens inside a single configuration file in the YAML format.
  • 37. Imports …or share your feature configurations
  • 38. Profiles $bin/behat –p google features/feature1
  • 39. The Drupal extension • Overrides default behaviors: – Snippets follow Drupal coding standards – Mink Extension steps get synonyms for readability • Provides drivers to facilitate data setup – Blackbox – Drush – Drupal API • Adds support for Drupal: – Regions – Node types – Users and Roles – Taxonomy – Subcontexts for Contributed Modules
  • 40. Provides drivers for data set up • Works with Drupal 6, 7, and 8 • Connect with no privileges (local or remote) • Connect with Drush (local or remote) • Connect with the Drupal API (local only)
  • 41. About data setup • Every scenario must be able to run independent of other scenarios • Often work with a fresh copy of the production database • Can’t always assume the database has specific content • Separate architectural elements from content elements • Insert data to get reliable checks
  • 42. Drush: alias file http://drush.ws/examples/example.aliases.drushrc.php
  • 46. Regions Requires a map in the behat.yml file • label => css selector • This means regions don’t have to map directly to Drupal theme regions
  • 47. Structure > Blocks > (Theme) > Demonstrate block regions
  • 48. Nodes
  • 49. Users, roles and taxonomies
  • 52.
  • 53. If you have any questions or you want access for the full installation guideline feel free to contact me on my email address: bboshnakov91@gmail.com
  • 54. Special thanks to: • Nikolay Ignatov • Boyan Borisov • Miroslav Banov • Toni Kolev
  • 55. Resources • http://dspeak.com/pnwds/6-drupalextension.html • http://docs.behat.org/guides/7.config.html • http://behat.org/ • http://mink.behat.org/

Editor's Notes

  1. Most of the programmers are smart and it is very important when building software. What I mean…
  2. This is not good for big projects
  3. This is not good for big projects
  4. This is not good for big projects
  5. TDD Defined: - Decide what the code will do Write a test that will pass if the code does that thing Run the test, see it fail Write the code Run the test see it pass TDD Provides: Design and plan before you code Document your design Proof that code implements design Encourages design of testable code
  6. “BDD is about implementing an application by describing its behavior from the perspective of its stakeholders.” – Dan North The original developer of BDD (Dan North) came up with the notion of BDD because he was dissatisfied with the lack of any specification within TDD of what should be tested and how. BDD – Second generation of agile methodology User stories Domain-Driven Development Extreme Programmin TDD Acceptance Driven Test Planning Continuous integration
  7. Сега ще покажа прост пример как да опишем тези неща.
  8. И сега ще си поговорим как точно да сложим бехат на нашите локални машини.
  9. Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
  10. This file is the Composer binary. It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things.
  11. Sometimes, Behat’s default configuration is not enough. Some day you’ll need some extended tools to configure your feature suite. For that day, Behat has a very powerful configuration system based on YAML configuration files and profiles.
  12. Every *.feature file conventionally consists of a single feature. Lines starting with the keyword Feature: (or its localized equivalent) followed by three indented lines starts a feature. A feature usually contains a list of scenarios. You can write whatever you want up until the first scenario, which starts withScenario: (or localized equivalent) on a new line. You can use tags to group features and scenarios together, independent of your file and directory structure. Every scenario consists of a list of steps, which must start with one of the keywords Given, When, Then, But or And (or localized one). Behat treats them all the same, but you shouldn’t. Here is an example:
  13. There’s huge amount of browser emulators out there, like Goutte, Selenium, Sahi and others. They all do the same job, but do it very differently. They behave differently and have very different API’s. But, what’s more important - there’s actually 2 completely different types of browser emulators out there: Headless browser emulators Browser controllers
  14. First type browsers are simple pure HTTP specification implementations, likeGoutte. Those browser emulators send a real HTTP requests against an application and parse the response content. They are very simple to run and configure, because this type of emulators can be written in any available programming language and can be run through console on servers without GUI. Headless emulators have both, advantages and disadvantages. Advantages are simplicity, speed and ability to run it without the need in real browser. But this type of browsers have one big disadvantage - they have no JS/AJAX support. So, you can’t test your rich GUI web applications with headless browsers. Second browser emulators type are browser controllers. Those emulators aims to control the real browser. That’s right, a program to control another program. Browser controllers simulate user interactions on browser and are able to retrieve actual information from current browser page. Selenium and Sahi are two most famous browser controllers. The main advantage of browser controllers usage is the support for JS/AJAX interactions on page. Disadvantage is that such browser emulators require installed browser, extra configuration are usually much slower than headless counterparts.
  15. There’s huge amount of browser emulators out there, like Goutte, Selenium, Sahi and others. They all do the same job, but do it very differently. They behave differently and have very different API’s. But, what’s more important - there’s actually 2 completely different types of browser emulators out there: Headless browser emulators Browser controllers
  16. Behat tries to load behat.yml or config/behat.yml by default, or you can tell Behat where your config file is with the --config option: Paths Formatter Colors Context Imports Environment Variable
  17. The imports block allows you to share your feature suite configuration between projects and their test suites. All files from the imports block will be loaded by Behat and merged into yourbehat.yml config.
  18. Profiles Extensions
  19. Profiles Extensions
  20. Profiles Extensions
  21. Profiles Extensions
  22. Examples
  23. Profiles Extensions
  24. Profiles Extensions
  25. Profiles Extensions
  26. The RegexpMapper changes filenames according to a pattern defined by a regular expression. This is the most powerful mapper and you should be able to use it for every possible application.
  27. The RegexpMapper changes filenames according to a pattern defined by a regular expression. This is the most powerful mapper and you should be able to use it for every possible application.