Presentation is loading. Please wait.

Presentation is loading. Please wait.

Behat - Arguably the best tool to switch to Automated testing from Manual Shweta Sharma.

Similar presentations


Presentation on theme: "Behat - Arguably the best tool to switch to Automated testing from Manual Shweta Sharma."— Presentation transcript:

1 Behat - Arguably the best tool to switch to Automated testing from Manual
Shweta Sharma

2 Behat: What and Why BDD PHP framework Cucumber
Validates business use cases Verification versus Validation Gherkin Automated test cases Several extensions

3 Prerequisites Apache Mysql PHP Composer - System wide installation

4 Local Installation Create a directory
List dependencies in composer.json composer install Configure behat.yml Initialize behat Verify your installation See list of predefined step definitions

5 composer.json

6 Structure of behat composer.json behat.yml Features directory
Feature files Bootstrap FeatureContext file

7 behat.yml

8 Feature file Feature Background Scenario / Scenario Outline Given When
Then And But

9 Mink extension What is it? Integration with Behat Ready to use
Hides API differences between different browser emulators Controlling the Browser Traversing pages Traversal methods Mink selectors Manipulate the pages Interact with the pages Integration with Behat

10 Example Using Mink

11 Mink drivers Mink Drivers - Goutte browserkit Selenium2 Zombie Sahi Selenium Execution Browser based Headless

12 Profiles Profiles Configure in behat.yml Multiple environments
Multiple browsers Overrides settings of default profile

13 Example - Profiles

14 Tagged scenarios Run selective scenarios / Tags Exclude scenarios
Configure in behat.yml Example: Tagged scenarios Run via command line Example: smoke, feature-specific, language-specific

15 Example - Tagged scenarios
Group by execution: bin\behat features Single scenario: bin\behat features\demo.feature:13 (line number of of the scenario) Exclude scenarios: bin\behat features --tags

16 Example

17 Custom step definitions
Custom step definitions / functions FeatureContext.php

18 Extensions Drupal extension Symfony extension Screenshot extension
Page Object extension Laravel extension Multiple API extensions Wordpress extension Reporting extensions

19 Demonstration Headless browser Using Chrome Tagged scenario
Using a profile

20 Thank You Twitter - https://twitter.com/shwetasharma84
LinkedIn - Github - Drupal.org - Skype - shweta_ns Full day training at DrupalCon Nashville Blogs -

21 Q & A Summary: Behat - http://docs.behat.org/en/v2.5/quick_intro.html
Gherkin Mink extension Mink drivers Tagged scenarios Profile Custom step definitions Behat - Mink -


Download ppt "Behat - Arguably the best tool to switch to Automated testing from Manual Shweta Sharma."

Similar presentations


Ads by Google