Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Shashikant Jagtap's Blog:
PHPUnit + Behat/Mink + Page Object: The Rockstar Combination of Testing
Apr 20, 2012 @ 15:49:54

Earlier this month Shashikant Jagtap wrote up a post about a powerful combination in testing your applications - a "rockstar" combo of PHPUnit + Behat/Mink + Page Object to give you a great foundation for BDD (behavior-driven) testing.

Last month, we had discussion about implementing page object pattern in Behat/Mink framework at London Behat Users meetup. Page object pattern is a cool way to make tests maintainable, reusable and readable. Everyone was interested to know more about Page Object Pattern. In this short tutorial, we will implement Mink and PHPUnit combination for functional testing. Mink and PHPUnit combined with Pageness (Page Object) can be used for maintainable and readable tests.

He assumes that you might not have all the tools needed installed, so he walks you through the setup/install of PHPUnit, the PHPUnit-Mink framework and both the Sahi and Selenium drivers. He includes a basic directory structure for the testing and shows how to create some Page Object classes that extend the default TestCase and make calling the remote resource simple. He also includes the steps needed to execute the tests via PHPUnit.

tagged: phpunit behat bdd testing mink pageobject

Link:

DZone.com:
The Page Object pattern
Apr 10, 2012 @ 14:05:39

On DZone.com today there's a new tutorial from Giorgia Sironi giving an example of working with the PageObject pattern and how it's implemented to help with testing in the PHPUnit_Selenium plugin.

In the realm of acceptance testing, a possibility for hooking into the application and exercising it end-to-end is to work through a user interface, which nowadays is in more and more cases web-based. The Page Object pattern is a way to model pages (intended as screens) of a web application as independent objects, and give them several responsibilities.

The pattern sets up the resources to let you make queries against the page's contents, interacting with elements on the page, running common assertions on the contents and moving around on the site. He gives a more practical example of it in action (again, using PHPUnit_Selenium) to test a login page and evaluate a successful login.

tagged: pageobject designpattern phpunit selenium unittest tutorial

Link:


Trending Topics: