Skip to main content

Automated Testing with Behat & Mink on Linux

Have time to read my introduction.

Behat + Mink + Selenium Server will do the automatic testing for your website. Behat handles your test cases in a form of a sentence which consist of the following

  • Feature - which is a description of your test case. Example is "Title Checking"
    • Scenario - Feature consist of Scenario's
      • Conditions - Scenario's consist of condition using the following tags "Given", "When", "Then", "And", "But"
Example feature: 


Feature: Google Search
@javascript
Scenario: Check Google Site
When I go to "http://www.google.com"
Then Capture a ScreenShot
@javascript
Scenario: Search Efren on Google
Given I am on "http://www.google.com"
When I input "Efren" in "gbqfq" element
When press "Google Search"
Then print current URL
Then Capture a ScreenShot
You need the following


  • Linux with the following server
    • php
    • php-gd
    • php-mysql
    • php-mbstring
    • php-xml
    • php-devel
    • php-pear
    • apache or httpd
    • mysql-server
    • mysql-client
    • firefox
    • gnome or kde
    • java

  • Do the following
    • cd ~/
    • mkdir behat
    • cd behat
    • curl -sS https://getcomposer.org/installer | php
    • download the ff and put it in your behat folder
      • https://drive.google.com/file/d/0B9Xc5UE7j8u9NW5jMmktZ01SeDA/view?usp=sharing
      • https://drive.google.com/file/d/0B9Xc5UE7j8u9QmlpZmF4MFN1b2M/view?usp=sharing
      • https://drive.google.com/file/d/0B9Xc5UE7j8u9VUduX3RWc0JJWm8/view?usp=sharing
      • https://drive.google.com/file/d/0B9Xc5UE7j8u9WnZ2d1NxMlNnZ3c/view?usp=sharing

    • ./composer.phar install

  • Selenium server
    • Download selenium server in http://www.seleniumhq.org/download/
    • java -jar selenium-server-standalone-xxxx.jar



  • sample feature
    • https://drive.google.com/file/d/0B9Xc5UE7j8u9eVhxLXllZndGZTg/view?usp=sharing

  • just run the
    • bin/behat
    • your should see test1.jpg










Comments

Popular posts from this blog

take a snapshot online via your webcam

I'm fully newbie on flash but I manage to mix php and flash, i had a client which prefer a web cam app online, well that was 2007 ago, but when i notice y flash had this feature accessing a client web cam i was thinking if i can do some snapshot on it. well I've done it. to those who needs my app email me or leave you email here. well i might come out with free version but maybe with some banners on just for the just for a credit on my own. and also to those who wants some sample I can update my site upon your request.

Trac Project Management Monitoring Installation

This guide assumes that you know how to install python packages Requirements sqlite backend: python sqlite and devel pysqlite genshi Installation: Install all the requirements add user by  #htdigest -c /path/to/your/passwordfile.txt realname username enter password  create you project #trac-admin /path/to/your/project enter information to remove sample wiki  #trac-admin /path/to/your/project wiki remove '*' to start your trac tracd -p 8080 --auth=*,/path/to/your/passwordfile.txt,realname /path/to/your/project