SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Automated Web
Acceptance Testing with
        Behat
        Shashikant Jagtap
      Twitter : @Shashikant86
Overview




    Behat : BDD for PHP

    Mink: Web Acceptance Testing Framework

    Behat with Sauce Labs for cloud testing

    Relish for living documentation

    Building feature with Jenkins

    Useful Links
Behat : BDD for PHP


    Behat is a BDD framework for PHP applications.
                     http://behat.org/




    BDD approach



    Feature is defined in story format.



    Domain Specific Language used is 'Gherkin'.



    Behat is developed by Konstantin Kudryashov (@everzet)
Mink


    Mink is a acceptance test framework for PHP applications
                   http://mink.behat.org/

  Mink has different drivers for browser emulation. Bowser emulation
can be headless or with browser controllers.
Mink supports both selenium1 driver as well as webdriver.




    Mink has various API's that can used to control browser actions.
Full list of Mink API's can found here




                 http://mink.behat.org/api/
Basic Browser Interactions
Source: http://mink.behat.org/
Installations


    Behat Installation: Run following commands from your pear channel
$ sudo pear channel-discover pear.behat.org
$ sudo pear channel-discover pear.symfony.com
$ sudo pear install behat/gherkin-beta
$ sudo pear install behat/behat-beta

    Mink Installation
$ pear channel-discover pear.symfony.com
$ pear channel-discover pear.behat.org
$ pear install behat/mink

    Check Installations
$ behat –version
   Behat version 2.2.0
Mink can be used by including following file in PHP classes.
    require_once 'mink/autoload.php';
Start Your Project

Navigate to the project root directory and initialize Behat by running these commands:
FeatureContext.php
Bootstrap.php

    Create 'features->bootstrap->bootstrap.php' and include mink and all other third
    party libraries in it.

    Include bootstrap.php into 'FeatureContext.php'.
Behat.yml

    Create 'behat.yml'. This is configuration file to run features

    You can specify mink driver, base url and browser of your choice.

    This file uses 'selenium' driver to run feature.
wikiSearch.feature

    Now, write sample feature file. This feature file good example of data-driven tests.
Get code for Step Definitions

    Now, you are ready to run 'behat' command again. This will give you example code for undefined
    steps
Implement Step definitions


    Now, copy example code and paste it in 'FeatureContext.php'

    Use Mink API's to implement steps like this
Start your engine

    Download Selenium from http://seleniumhq.org/download/

    Run Selenium server using command
    $java -jar selenium-server-standalone-2.15.0.jar
Watch your Test running

    Now run 'behat' again and watch your test running in browser.
Watch Your Test Passed
Behat with Sauce Labs

    Sauce Labs is a cloud testing service which allows tests to run in cloud machine with
    specified browser. http://saucelabs.com/

    Behat features can be run on sauce labs by simple configuration

    We need to create another configuration file to run features on Sauce Labs.
Create 'sauce.yml'

    In order to run feature on Sauce Labs, we need to create 'sauce.yml' as a
    config file. You need Sauce labs 'username' and 'API key'.
Run Feature on Sauce Labs

    You need to tell behat to pick 'sauce.yml' as config file
      $behat -c sauce.yml

    You can watch video this job here: http://snipurl.com/21y5lb6
Relish: Living Documentation


    Relish is cool tool to manage Gherkins feature files online.
    https://www.relishapp.com/relish/relish/docs

    Install Relish
You need to have Ruby gems installed on your system.
        $gem install relish

    Create Project
        $relish projects:add projectName
# or, if you want a private project:
        $relish projects:add my-secret-project:private

    Push your files online
       $relish push my-best-project
    moonstar:NewBehat sjagtap$ relish push sjagtap/acne
    sent:
    features/wikiSearch.feature
Relish


    You can find our feature on Relish here
    https://www.relishapp.com/sjagtap/acne/docs/wikisearch
Source Code from GitHub


Get Sample Source Code available on GitHub




       https://github.com/Shashi-ibuildings/Behat-Sauce
Clone the repository




     $ git clone git@github.com:Shashi-ibuildings/Behat-Sauce.git
     $ cd /path to/Behat-Sauce
Edit ‘Sauce.yml’ file in order to specify your username and API key. Now, Run



ANT command to execute feature on sauce Labs
      $ ant runSauce
See the reports generated in 'report/report.html' file.

Directory Structure


    Once you cloned project, You will have following files in the project,
    directory structure looks like this
Running Features on Jenkins

    Jenkins is continuous integration server

    To configure Behat with CI server, we need 'build.xml ' file

    You need to have Jenkins installed on server or localhost
- We will Run Jenkins
- moonstar:~ sjagtap$ java -jar jenkins-1.war

    Visit http://localhost:8080/ to see Jenkins Dashboard

    Create new job called “BehatSauce”. Specify it as 'Build a free-style
    software project.

    Specify Git repository as SCM.

    Select ‘Invoke Ant’ from ‘Build’ and specify ‘runSauce’ target

    Specify HTML report path. (You need to have HTML report plugin
    installed on Jenkins)
Jenkins Configuration
Jenkins Configuration Contd..
Jenkins Project
Jenkins Test Report
Links


     Blogpost 'Adding Sauce To behat'
http://saucelabs.com/blog/index.php/2012/01/adding-sauce-to-behat/

     Video Demo
http://www.youtube.com/watch?v=Zu9mWuVvsUQ

     Source Code on GitHub
    https://github.com/Shashi-ibuildings/Behat-Sauce

     Relish Documentation
https://www.relishapp.com/sjagtap/acne

     My Blogs
http://lestbddphp.wordpress.com/

     About Me
    http://about.me/shashikantjagtap
Questions
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014StĂŠphane BĂŠgaudeau
 
What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017Matt Raible
 
Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsSylwester Madej
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow soloviniciusban
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetupSyam Sasi
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...Badoo
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Adrian Philipp
 
Autotesting rails app
Autotesting rails appAutotesting rails app
Autotesting rails appAnton Naumenko
 
An iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React NativeAn iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React NativeAleksandras Smirnovas
 
Ionic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocksIonic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocksJuarez Filho
 
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Matt Raible
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsYakov Fain
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsYakov Fain
 
No Va Taig April 7 2010
No Va Taig April 7 2010No Va Taig April 7 2010
No Va Taig April 7 2010rudy regner
 
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017Matt Raible
 
Puppeteer: Getting Started
Puppeteer: Getting StartedPuppeteer: Getting Started
Puppeteer: Getting StartedHyunSeob Lee
 
Building the Front End with AngularJS
Building the Front End with AngularJSBuilding the Front End with AngularJS
Building the Front End with AngularJSJohn Ennew
 

Was ist angesagt? (20)

Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014
 
What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017
 
Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and Jenkins
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
 
React Native
React NativeReact Native
React Native
 
Autotesting rails app
Autotesting rails appAutotesting rails app
Autotesting rails app
 
An iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React NativeAn iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React Native
 
Ionic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocksIonic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocks
 
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
No Va Taig April 7 2010
No Va Taig April 7 2010No Va Taig April 7 2010
No Va Taig April 7 2010
 
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
 
Puppeteer: Getting Started
Puppeteer: Getting StartedPuppeteer: Getting Started
Puppeteer: Getting Started
 
Building the Front End with AngularJS
Building the Front End with AngularJSBuilding the Front End with AngularJS
Building the Front End with AngularJS
 
Ionic2
Ionic2Ionic2
Ionic2
 

Andere mochten auch

Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleShashikant Jagtap
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaIosif Itkin
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsIosif Itkin
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile AppsSauce Labs
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiYukiya Nakagawa
 

Andere mochten auch (6)

Headless BDD
Headless BDDHeadless BDD
Headless BDD
 
Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber Example
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in Kostroma
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile Apps
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
 

Ähnlich wie Behat sauce

Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntukesavan N B
 
Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersAdam Englander
 
Continuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonContinuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonInexture Solutions
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance TestingAlan Hecht
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windowsDocker, Inc.
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as codedaisuke awaji
 
Using HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaUsing HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaSandeep Tol
 
Making a small QA system with Docker
Making a small QA system with DockerMaking a small QA system with Docker
Making a small QA system with DockerNaoki AINOYA
 
Deployment automation
Deployment automationDeployment automation
Deployment automationRiccardo Lemmi
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Githubhubx
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupalOscar Merida
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopVivek Krishnakumar
 
Intro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaIntro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaJason Noble
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
 
Session 2
Session 2Session 2
Session 2gayathiry
 
Session 2
Session 2Session 2
Session 2gayathiry
 
Introduce fuego
Introduce fuegoIntroduce fuego
Introduce fuegos60030
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?Niklas Heidloff
 
How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?Zend by Rogue Wave Software
 

Ähnlich wie Behat sauce (20)

Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
Php[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for BeginnersPhp[tek] 2016 - BDD with Behat for Beginners
Php[tek] 2016 - BDD with Behat for Beginners
 
Continuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonContinuous Integration using Jenkins with Python
Continuous Integration using Jenkins with Python
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
CodeShip
CodeShipCodeShip
CodeShip
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Using HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaUsing HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in Java
 
Making a small QA system with Docker
Making a small QA system with DockerMaking a small QA system with Docker
Making a small QA system with Docker
 
Deployment automation
Deployment automationDeployment automation
Deployment automation
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Github
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupal
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
Intro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaIntro to Rails Give Camp Atlanta
Intro to Rails Give Camp Atlanta
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
Introduce fuego
Introduce fuegoIntroduce fuego
Introduce fuego
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
 
How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?
 

Mehr von Shashikant Jagtap

NSTC2019: Choosing CI Friendly Mobile Automation Framework
NSTC2019: Choosing CI Friendly Mobile Automation Framework NSTC2019: Choosing CI Friendly Mobile Automation Framework
NSTC2019: Choosing CI Friendly Mobile Automation Framework Shashikant Jagtap
 
SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App Shashikant Jagtap
 
Full Stack Flutter Testing
Full Stack Flutter Testing Full Stack Flutter Testing
Full Stack Flutter Testing Shashikant Jagtap
 
XCUITest Introduction: Test Automation University
XCUITest Introduction: Test Automation University XCUITest Introduction: Test Automation University
XCUITest Introduction: Test Automation University Shashikant Jagtap
 
iOSDevUK Conference- DevOps for iOS Apps
iOSDevUK Conference- DevOps for iOS AppsiOSDevUK Conference- DevOps for iOS Apps
iOSDevUK Conference- DevOps for iOS AppsShashikant Jagtap
 
Vapor london March 2018
Vapor london March 2018Vapor london March 2018
Vapor london March 2018Shashikant Jagtap
 
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleProvisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleShashikant Jagtap
 
BDD with Behat Selenium, Sahi and Sauce
BDD with Behat Selenium, Sahi and SauceBDD with Behat Selenium, Sahi and Sauce
BDD with Behat Selenium, Sahi and SauceShashikant Jagtap
 
Test Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+SahiTest Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+SahiShashikant Jagtap
 

Mehr von Shashikant Jagtap (9)

NSTC2019: Choosing CI Friendly Mobile Automation Framework
NSTC2019: Choosing CI Friendly Mobile Automation Framework NSTC2019: Choosing CI Friendly Mobile Automation Framework
NSTC2019: Choosing CI Friendly Mobile Automation Framework
 
SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App
 
Full Stack Flutter Testing
Full Stack Flutter Testing Full Stack Flutter Testing
Full Stack Flutter Testing
 
XCUITest Introduction: Test Automation University
XCUITest Introduction: Test Automation University XCUITest Introduction: Test Automation University
XCUITest Introduction: Test Automation University
 
iOSDevUK Conference- DevOps for iOS Apps
iOSDevUK Conference- DevOps for iOS AppsiOSDevUK Conference- DevOps for iOS Apps
iOSDevUK Conference- DevOps for iOS Apps
 
Vapor london March 2018
Vapor london March 2018Vapor london March 2018
Vapor london March 2018
 
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleProvisioning iOS CI Server with Ansible
Provisioning iOS CI Server with Ansible
 
BDD with Behat Selenium, Sahi and Sauce
BDD with Behat Selenium, Sahi and SauceBDD with Behat Selenium, Sahi and Sauce
BDD with Behat Selenium, Sahi and Sauce
 
Test Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+SahiTest Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+Sahi
 

KĂźrzlich hochgeladen

Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...
Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...
Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...Sheetaleventcompany
 
📞 Contact Number 8617370543VIP Hardoi Call Girls
📞 Contact Number 8617370543VIP Hardoi Call Girls📞 Contact Number 8617370543VIP Hardoi Call Girls
📞 Contact Number 8617370543VIP Hardoi Call GirlsNitya salvi
 
Payal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace Colaba
Payal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace ColabaPayal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace Colaba
Payal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace ColabaPooja Nehwal
 
💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...
💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...
💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...Sheetaleventcompany
 
Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...
Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...
Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...Nitya salvi
 
Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...
Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...
Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...rajveerescorts2022
 
Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...
Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...
Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...rajveerescorts2022
 
Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...
Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...
Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...Pooja Nehwal
 
Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...
Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...
Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...Nitya salvi
 
9867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x7
9867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x79867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x7
9867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x7Pooja Nehwal
 
Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...
Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...
Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...minkseocompany
 
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...mitaliverma221
 
Style Victorious Cute Outfits for Winners
Style Victorious Cute Outfits for WinnersStyle Victorious Cute Outfits for Winners
Style Victorious Cute Outfits for Winnersolva0212
 
Top 10 Moisturising Cream Brands In India - Stelon Biotech
Top 10 Moisturising Cream Brands In India - Stelon BiotechTop 10 Moisturising Cream Brands In India - Stelon Biotech
Top 10 Moisturising Cream Brands In India - Stelon BiotechStelon Biotech
 
PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...
PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...
PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...Sheetaleventcompany
 
Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...Nitya salvi
 
Introduction to Fashion Designing for all
Introduction to Fashion Designing for allIntroduction to Fashion Designing for all
Introduction to Fashion Designing for allMuhammadDanishAwan1
 
"Paltr Packaging: Streamlined Order Process for Seamless Deliveries"
"Paltr Packaging: Streamlined Order Process for Seamless Deliveries""Paltr Packaging: Streamlined Order Process for Seamless Deliveries"
"Paltr Packaging: Streamlined Order Process for Seamless Deliveries"Aarisha Shaikh
 
Tirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tirunelveli
Tirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime TirunelveliTirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tirunelveli
Tirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tirunelvelimeghakumariji156
 
Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...
Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...
Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...Pooja Nehwal
 

KĂźrzlich hochgeladen (20)

Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...
Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...
Gorgeous Call Girls In Jaipur {9521753030} ❤️VVIP ANKITA Call Girl in Jaipur ...
 
📞 Contact Number 8617370543VIP Hardoi Call Girls
📞 Contact Number 8617370543VIP Hardoi Call Girls📞 Contact Number 8617370543VIP Hardoi Call Girls
📞 Contact Number 8617370543VIP Hardoi Call Girls
 
Payal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace Colaba
Payal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace ColabaPayal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace Colaba
Payal Mehta 9867746289, Escorts Service Near The Taj Mahal Palace Colaba
 
💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...
💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...
💚Call Girl In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girls No💰Advance Cash...
 
Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...
Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...
Escorts Service Model Hathras 👉 Just CALL ME: 8617370543 💋 Call Out Call Both...
 
Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...
Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...
Call Girls In Mohali ☎ 9915851334☎ Just Genuine Call Call Girls Mohali 🧿Elite...
 
Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...
Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...
Zirakpur Call Girls ✅ Just Call ☎ 9878799926☎ Call Girls Service In Mohali Av...
 
Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...
Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...
Mahim Call Girls in Bandra 7738631006, Sakinaka Call Girls agency, Kurla Call...
 
Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...
Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...
Call Girls In Jamnagar Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enj...
 
9867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x7
9867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x79867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x7
9867746289 - Payal Mehta Book Call Girls in Versova and escort services 24x7
 
Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...
Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...
Top 20: Best & Hottest Russian Pornstars Right Now (2024) Russian Porn Stars ...
 
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East P...
 
Style Victorious Cute Outfits for Winners
Style Victorious Cute Outfits for WinnersStyle Victorious Cute Outfits for Winners
Style Victorious Cute Outfits for Winners
 
Top 10 Moisturising Cream Brands In India - Stelon Biotech
Top 10 Moisturising Cream Brands In India - Stelon BiotechTop 10 Moisturising Cream Brands In India - Stelon Biotech
Top 10 Moisturising Cream Brands In India - Stelon Biotech
 
PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...
PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...
PREET❤️Call girls in Jalandhar ☎️8264406502☎️ Call Girl service in Jalandhar☎...
 
Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
Call Girls In Raigad Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service Enjoy...
 
Introduction to Fashion Designing for all
Introduction to Fashion Designing for allIntroduction to Fashion Designing for all
Introduction to Fashion Designing for all
 
"Paltr Packaging: Streamlined Order Process for Seamless Deliveries"
"Paltr Packaging: Streamlined Order Process for Seamless Deliveries""Paltr Packaging: Streamlined Order Process for Seamless Deliveries"
"Paltr Packaging: Streamlined Order Process for Seamless Deliveries"
 
Tirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tirunelveli
Tirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime TirunelveliTirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tirunelveli
Tirunelveli Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tirunelveli
 
Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...
Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...
Andheri East ) Call Girls in Mumbai Phone No 9004554577, Vashi Call Girls Ser...
 

Behat sauce

  • 1. Automated Web Acceptance Testing with Behat Shashikant Jagtap Twitter : @Shashikant86
  • 2. Overview  Behat : BDD for PHP  Mink: Web Acceptance Testing Framework  Behat with Sauce Labs for cloud testing  Relish for living documentation  Building feature with Jenkins  Useful Links
  • 3. Behat : BDD for PHP  Behat is a BDD framework for PHP applications. http://behat.org/  BDD approach  Feature is defined in story format.  Domain Specific Language used is 'Gherkin'.  Behat is developed by Konstantin Kudryashov (@everzet)
  • 4. Mink  Mink is a acceptance test framework for PHP applications http://mink.behat.org/  Mink has different drivers for browser emulation. Bowser emulation can be headless or with browser controllers. Mink supports both selenium1 driver as well as webdriver.   Mink has various API's that can used to control browser actions. Full list of Mink API's can found here  http://mink.behat.org/api/
  • 5. Basic Browser Interactions Source: http://mink.behat.org/
  • 6. Installations  Behat Installation: Run following commands from your pear channel $ sudo pear channel-discover pear.behat.org $ sudo pear channel-discover pear.symfony.com $ sudo pear install behat/gherkin-beta $ sudo pear install behat/behat-beta  Mink Installation $ pear channel-discover pear.symfony.com $ pear channel-discover pear.behat.org $ pear install behat/mink  Check Installations $ behat –version Behat version 2.2.0 Mink can be used by including following file in PHP classes. require_once 'mink/autoload.php';
  • 7. Start Your Project Navigate to the project root directory and initialize Behat by running these commands:
  • 9. Bootstrap.php  Create 'features->bootstrap->bootstrap.php' and include mink and all other third party libraries in it.  Include bootstrap.php into 'FeatureContext.php'.
  • 10. Behat.yml  Create 'behat.yml'. This is configuration file to run features  You can specify mink driver, base url and browser of your choice.  This file uses 'selenium' driver to run feature.
  • 11. wikiSearch.feature  Now, write sample feature file. This feature file good example of data-driven tests.
  • 12. Get code for Step Definitions  Now, you are ready to run 'behat' command again. This will give you example code for undefined steps
  • 13. Implement Step definitions  Now, copy example code and paste it in 'FeatureContext.php'  Use Mink API's to implement steps like this
  • 14. Start your engine  Download Selenium from http://seleniumhq.org/download/  Run Selenium server using command $java -jar selenium-server-standalone-2.15.0.jar
  • 15. Watch your Test running  Now run 'behat' again and watch your test running in browser.
  • 16. Watch Your Test Passed
  • 17. Behat with Sauce Labs  Sauce Labs is a cloud testing service which allows tests to run in cloud machine with specified browser. http://saucelabs.com/  Behat features can be run on sauce labs by simple configuration  We need to create another configuration file to run features on Sauce Labs.
  • 18. Create 'sauce.yml'  In order to run feature on Sauce Labs, we need to create 'sauce.yml' as a config file. You need Sauce labs 'username' and 'API key'.
  • 19. Run Feature on Sauce Labs  You need to tell behat to pick 'sauce.yml' as config file $behat -c sauce.yml  You can watch video this job here: http://snipurl.com/21y5lb6
  • 20. Relish: Living Documentation  Relish is cool tool to manage Gherkins feature files online. https://www.relishapp.com/relish/relish/docs  Install Relish You need to have Ruby gems installed on your system. $gem install relish  Create Project $relish projects:add projectName # or, if you want a private project: $relish projects:add my-secret-project:private  Push your files online $relish push my-best-project moonstar:NewBehat sjagtap$ relish push sjagtap/acne sent: features/wikiSearch.feature
  • 21. Relish  You can find our feature on Relish here https://www.relishapp.com/sjagtap/acne/docs/wikisearch
  • 22. Source Code from GitHub Get Sample Source Code available on GitHub  https://github.com/Shashi-ibuildings/Behat-Sauce Clone the repository  $ git clone git@github.com:Shashi-ibuildings/Behat-Sauce.git $ cd /path to/Behat-Sauce Edit ‘Sauce.yml’ file in order to specify your username and API key. Now, Run  ANT command to execute feature on sauce Labs $ ant runSauce See the reports generated in 'report/report.html' file. 
  • 23. Directory Structure  Once you cloned project, You will have following files in the project, directory structure looks like this
  • 24. Running Features on Jenkins  Jenkins is continuous integration server  To configure Behat with CI server, we need 'build.xml ' file  You need to have Jenkins installed on server or localhost - We will Run Jenkins - moonstar:~ sjagtap$ java -jar jenkins-1.war  Visit http://localhost:8080/ to see Jenkins Dashboard  Create new job called “BehatSauce”. Specify it as 'Build a free-style software project.  Specify Git repository as SCM.  Select ‘Invoke Ant’ from ‘Build’ and specify ‘runSauce’ target  Specify HTML report path. (You need to have HTML report plugin installed on Jenkins)
  • 29. Links  Blogpost 'Adding Sauce To behat' http://saucelabs.com/blog/index.php/2012/01/adding-sauce-to-behat/  Video Demo http://www.youtube.com/watch?v=Zu9mWuVvsUQ  Source Code on GitHub https://github.com/Shashi-ibuildings/Behat-Sauce  Relish Documentation https://www.relishapp.com/sjagtap/acne  My Blogs http://lestbddphp.wordpress.com/  About Me http://about.me/shashikantjagtap