RESTful API Testing with Behat and Guzzle

BDD
Behat and Guzzle Behat is a behaviour driven development framework for the PHP application. Behat can be used for acceptance testing and api testing. Guzzle is PHP HTTP client to work with HTTP and web services. You can read more about Guzzle on the official website . We can use combination of the Behat and Guzzle for the testing of the REST API. In this post, we will see how to use Guzzle http  for testing GitHub web services. Behat in Action Let's do some action now. We will install behat, create feature simple file and implement step definitions. Installation & Config Let's create our composer.json to install all the dependencies with composer. [crayon-58a98624dbe30260193064/] Now, we need to download composer and install all these dependencies [crayon-58a98624dbe43807942988/] This will install all the dependencies in…
Read More

Behat Mink and headless ZombieJS [Updated]

BDD
Behat-Zombie Hope you had enjoyed my previous blog post about setting up Behat-Mink and Zombie driver. It was broken due to latest changes in the driver. Here are some updates, you need to do in order to get it working Upgrade Node [crayon-58a98624ddcfd947970907/] Upgrade npm [crayon-58a98624ddd0a283288835/] Once you upgrade node and npm then you need to update behat.yml pointing to node_module as shown in the video below. Watch Video Demo   https://www.youtube.com/watch?v=hyw7efbuKdc&feature=youtu.be  
Read More

Running Behat Scenarios with PahntomJS

BDD
Behat Behat is a Behavior Driven Development tool for the PHP application. Behat and Mink uses many drivers like Selenium, Sahi, Zombie and goutte to launch scenarios. In this post, we will see how to run Behat scenarios using an awesome tool called 'PhantomJS'. We will use a existing Demo project on GitHub. [crayon-58a98624de314286947221/] PhantomJS PhantomJS is a headless browser with full support of JavaScript. PhantomJS can be used for the various purpose like Headless Website Testing Page Automation Network Monitoring Installation On Mac OSX, you can install it with HomeBrew [crayon-58a98624de322435232220/] You can now check if PhantomJS installed using [crayon-58a98624de329572544038/] Now you are good to go with PahntomJS and Behat Behat, Selenium and PhantomJS In order to use PhantomJS with Behat-Mink and Selenium. We need to launch it on…
Read More

Headless BDD with Zombie and PhantomJS

BDD
Headless BDD Just given a talk on "Headless BDD" at Agile Testing Meetup, London on 26 June, 2013. I would like to take this opportunity to thank organiser Tony Bruce [@tonybruce77] and sponsors of meetup. The title of the talk was bit vague. Having said that I mean using Headless Drivers with BDD tools to drive your scenarios. This talks was based on two popular BDD tools Cucumber and Behat. headless drivers used for the demo are Zombie and PhantomJS Source Code Source code of the both tools are available on GitHub Behat + Mink + Zombie : Shashikant86/Behat-Zombie GitHub Cucumber + Capybara + Poltergeist : Shashikant86/Poltergeist-Demo   Slides Here are the slides of the talk Headless BDD from Shashikant Jagtap
Read More

Living Documentation in the BDD with Relish

BDD
BDD and Living Documentation Bridging the communication Gap between Business and Technology is a main goal of the Behaviour Driven Development [BDD]. By adopting practices of BDD , we can write scenarios in human readable language so that non-technical people can understand scenarios and specifications. It's always good idea to have scenarios in human readable language but there is a issue, where to write down those scenarios?. Here are few possible solutions that  you may think of  Write down scenarios on Paper so that business people can read. Write scenarios in the Collaborative Tools like Mingle, JIRA and tell business people to have a look. You are free to keep it in the Source Control like SVN or Git.  Use traditional approach like Excel sheets, Spreadsheets and keep it in the Google…
Read More

Speed up your BDD with Sublime Text 2

BDD
Abstract As far as I remember, We had London Behat User's meetup at SkillsMatter, London on 23, May 2012 titled "Speed up your BDD with Sublime Text 2" Christophe Willemsen [@ikwattro] came to London all the way from Belgium to present Behat/Mink Snippets he worked on. Here is  Github repository.  Now these snippets are part of Package Controller of the Sublime Text 2. I would like to thank him for his awesome work. In this short tutorial, I will try to explain his work on Behat snippets for Sublime Text 2 and use of Gherkin syntax. BDD & Feature Files The key benefit of the Behavior Driven Development [BDD] is to bridge communication gap by writing human readable specifications. In the language of BDD, these specifications are often written in…
Read More

Running Cross browser BDD scenarios in Parallel with ANT

Automation, BDD
Cross-Browser BDD Scenarios Cross-Browser testing is a essential part of the automated test suite. While working with Behaviour Driven Development tools like Cucumber and Behat, we must have necessary setup to run BDD scenarios in parallel. Let's consider, we have test suite which runs in Firefox, Safari and Google in parallel. What an awesome idea ! In this tutorial we will we will see how to run cross-browser BDD scenarios in parallel using apache-ANT Apache ANT Apache ANT is a java based build tool. You can use another  build tools like phing Or maven but I like ANT as it's very simple to learn and so powerful. Install ANT There is complete installation guide on the apache ant website here. I think, you are smart enough to google it and get ANT installed on your…
Read More

Take Good Care of Given-When-Then in the BDD

BDD
 BDD, Feature File & Gherkin Syntax Behaviour Driven Development a.k.a BDD enforces agile team to write human readable, executable specification. Gherkin is a very nice Domain specific Language which support human readable syntax in different languages. BDD is all about bridging communication gap so writing better feature file is a key to success in the BDD projects. Once you have all necessary communication with business, next step is to write feature files. Ideally, QA should take lead to write down all scenarios, preconditions and expected results in the form of feature files. Business analysts / product owners or even scrum masters can contribute to feature files. Once the team agrees all possible scenarios have been covered, then developers can kick start implementation. Few tips to write better feature files  1.…
Read More

Cross-Browser Testing with Behat, Mink and Selenium

BDD
Behat Demo Hope you are enjoying Behat scenarios running in a firefox as it's default driver for MinkExtension. How about running those scenarios in different browsers? We can use selenium/WebDriver  to run those scenarios in different browsers. Let's say we have a sample project, e.g here is one on my GitHub account called "Behat-Demo" Cross-Browser In order to run those scenarios in different browsers, we need to change config file 'behat.yml'. Let's change config to run tests in "Safari" [crayon-58a98624e0d32724639071/] You can change different browsers like safari, firefox opera etc etc. When it comes to running scenarios in Google chrome, we need to switch to 'selenium' driver. [crayon-58a98624e0d40543680584/] Currently it's not possible to connect to GoogleChrome using WebDriver Or ChromeDriver. ENJOY THIS VIDEO !! http://www.youtube.com/watch?v=pTMZfxzyt4w  
Read More

Using Zombie.js Driver with Behat’s MinkExtension[Updated]

BDD
Zombie.js Zombie.js is a headless browser which uses Node.js, NPM, a C++ compiler and Python. We can use Zombie.js with Behat's MinkExtesion to make your BDD scenarios much faster. We have seen that we can also use Selenium, WebDriver, Sahi etc etc with MinkExtension. Here are few Benefits you can achieve using Zombie.js You don't need browser so your tests become so fast. You don't need to launch Server before running tests, Zombie will automatically do it for you, saving your time and efforts. Robust automated tests. Easy to setup on Linux and Mac OSX servers. Being honest, it was pain in everywhere until I got Zombie working in my local machine. I managed to get it working on Linux (Ubuntu) by taking help from Behat community, but faced many issues while getting…
Read More