News Feed
Sections




News Archive
feed this:

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

Codeception.com:
Working with PHPUnit and Selenium Webdriver
November 21, 2013 @ 12:15:43

On the Codeception site they've recently posted a guide to using PHPUnit and the Selenium Webdriver to easily create functional tests for your application. They make use of the php-webdriver library from Facebook to make the connection inside the tests.

In this post we will explore some basics of user acceptance testing with Selenium. We will do this with classical unit testing framework PHPUnit, web browser Firefox, and with new php-webdriver library recently developed by Facebook. Selenium allows us to record user actions that we do inside a browser and then automate them. PHPUnit will be used to do various assertions and check them for fallacy. And php-webdriver is used to connect PHP with Selenium, in order to do browser manipulation in PHP.

They walk you through the installation process (pretty simple with Composer) and show you how to start up a standalone Selenium server to receive the test commands. From there they start in on the test examples make with PHPUnit, first creating a simple test that connects to Github and looks for "Github" in the page title. They list some of the more complex selector functions and put them to use finding an object by ID. Finally, they include a few handy tips about locating elements, handling "not found" items and some refactoring and test structure suggestions.

0 comments voice your opinion now!
phpunit selenium webdriver facebook tutorial functional testing

Link: http://codeception.com/11-12-2013/working-with-phpunit-and-selenium-webdriver.html

VG Tech Blog:
Selenium Tests
June 21, 2013 @ 11:26:30

On the VG Tech blog today there's a new post introducing Selenium testing to those that might not have heard of it before for functional testing. It's a powerful tool that can even be used from inside PHPUnit tests to automate evaluation of your frontend application.

When we develop code at VG we have started to use Selenium tests for continuous integration. This allows us to easy write tests that programmatically checks that last commit didn't break anything.

He describes some of the types of tests Selenium can do and mentions the IDE that can hook into Firefox and record your actions and translate them into tests. This includes the ability to export them to PHPUnit tests (sample code provided) that extend the "PHPUnit_Extensions_SeleniumTestCase." An example screenshot of what the IDE running looks like is also included.

0 comments voice your opinion now!
selenium test introduction phpunit export ide firefox

Link: http://tech.vg.no/2013/06/14/selenium-tests

Andrew Podner:
Functional Testing to Improve Quality Assurance (part 2)
June 03, 2013 @ 11:57:40

Andrew Podner has a posted the second part of his series looking at functional testing in PHP applications with Selenum.

In the first post about functional testing, we went through the basics of what functional testing is and how it complements and differs from other types of testing used for software quality assurance. This time, I will spend some time talking about using functional testing in a practical sense to set up a testing suite for a web based software project. [...] Each of these can provide a powerful means of performing automated functional testing and you should select your tool of choice based on what works best for you. I typically find myself using Selenium for functional testing, but again, I would encourage you to look at each available option out there and select the best fit

He walks you through the installation of the Selenium Firefox plugin, some of the basics of its use and how to create and run a simple test. He also looks at a slightly more complex example - filling in a form and validating the resulting page.

0 comments voice your opinion now!
functional testing quality assurance part2 series selenium

Link: http://unassumingphp.com/functional-testing-to-improve-quality-assurance-part-2

Michelangelo van Dam:
UA Testing with Selenium and PHPUnit
May 24, 2013 @ 10:18:40

In this new post to his site Michaelangelo van Dam looks at user acceptance testing with PHPUnit and Selenium.

Last week I spoke at php[tek] 2013 where I explained to people how to get started with Selenium IDE to record user interaction with the web interface, convert them to PHPUnit testcases and automatically execute them on multiple browsers on multiple platforms. The twitter I also received a bunch of questions regarding how to set up multiple platforms and why I used Windows in my presentation to deploy to. So today I deceided it was time to write a full article on this subject.

He introduces Selenium and what kinds of things it can be used to test. He also defines "user acceptance testing" and talks about why they're an important part of the testing ecosystem. He then walks you through the process of getting the testing environment set up, creating a few tests and how to convert them over to PHPUnit tests (using a built-in tool). Screencasts show you each step of the way. He includes a little tweaking you'll need to do to to the test code to get it working with your own Selenium server

0 comments voice your opinion now!
useracceptance testing phpunit selenium introduction

Link: http://www.dragonbe.com/2013/05/ua-testing-with-selenium-and-phpunit.html

Matt Frost:
Starting with Selenium (and Headless on a VM)
August 27, 2012 @ 08:16:55

Matt Frost has posted a two part series of some of his experiences in setting up Selenium to execute it in a VM and run tests on your application.

I was a little scared when it came to setting up Selenium, I figured it was going to be difficult to setup and configure. So I was pleasantly surprised when it really wasn't. So here are a few of the mistakes I made; since I use Vagrant to do all my development I actually grabbed Selenium and started from there. Not a good place to start, although as I found out later; not a total dead end.

He includes the initial setup of things like PHPUnit and the Selenium .jar file as well as a sample test that loads a page and checks the title of the page. His second post shows how to set it up in the VM (using Vagrant, xvfb to capture the output and Firefox to execute the tests).

0 comments voice your opinion now!
selenium frontend testing vm vagrant firefox java xvfb


Shashikant Jagtap's Blog:
Enjoy 'MinkExtension' for Behat
May 08, 2012 @ 10:55:55

In this new post to his blog Shashikant Jagtap talks about a new extension for Behat (the BDD testing tool) that makes working with Mink even easier - MinkExtension.

'MinkExtension' has been just released which has additional services for Behat. This extension has 'Mink' instance for your 'FeatureContext' and 'SubContext'. UI testers would be happy now, as they don't need to create Mink instance every time in order to use Mink API's.

He points you to an example application you can use to follow along. He includes the commands needed to install the dependencies via Composer and get this extension working (note: it requires PHP 5.4 for some of the traits stuff. If you don't want to use that, comment out the "TraitedFeatureContext.php" file). Also included are the commands to execute the tests with a Selenium server and a list of a few handy new things this extension enables.

0 comments voice your opinion now!
minkextension mink behat bdd testing frontend selenium


DZone.com:
Selenium on Android
April 18, 2012 @ 12:43:04

On DZone.com there's a recent post from Giorgio Sironi looking at running Selenium tests on the Android platform via the PHPUnit Selenium interface.

Testing web applications is not only based on unit and functional tests for the server-side (PHP, Java) and client-side (JavaScript) components, but also on end-to-end tests like the ones performed with Selenium. Selenium is capable of driving a real browser like Firefox in the same way a user would do, letting you express a test with a series of page to load, element selections, clicks and typed characters. [...] In this tutorial, we'll experiment with the Android Driver and set up a couple of tests to run inside an Android virtual device.

He walks you through the basic setup of an Android environment (based on the Android SDK) and how to start up the Android driver installed from the Selenium site. An example test is included, showing how to make a request for a test page and checking its title as well as checking that the input from the "keyboard" is successful.

0 comments voice your opinion now!
selenium android phpunit webdriver sdk


DZone.com:
The Page Object pattern
April 10, 2012 @ 09: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.

0 comments voice your opinion now!
pageobject designpattern phpunit selenium unittest tutorial


DZone.com:
PHPUnit_Selenium
January 20, 2012 @ 09:12:18

On DZone.com today Giorgio Sironi has a quick tutorial showing you how to set up and use the PHPUnit_Selenium component in the latest releases of the popular testing software.

With the 1.2 release, PHPUnit_Selenium supports (basically) for the first time the Selenium 2 WebDriver API. While PHPUnit_Selenium already worked with Selenium 2, it did so only by using the Selenium 1 emulation included in the jar; now it provides an object-oriented API right natively supported in a base PHPUnit test case, shipped in PHPUnit's PEAR channel.

He includes the steps you'll need to pull it from the PEAR channel and how to set up a test case based on the PHPUnit_Extensions_Selenium2TestCase object. He gives a few examples of how to select various components on the page (via CSS selectors and XPath), assert that the right information is there and interact with forms.

0 comments voice your opinion now!
phpunit selenium install unittest tutorial example select interact


DZone.com:
Open/Closed Principle on real world code
January 13, 2012 @ 09:05:53

In a new post to DZone.com Giorgio Sironi talks about the "open/closed principle" in software development and shows an example based on the design of the PHPUnit_Selenium project.

This article shows an example of how the application of the Open/Closed Principle improved the design of a real project, the open source library PHPUnit_Selenium. These design concepts apply to every object-oriented language, including Java, Ruby or even C++. The Open Closed Principle, part of SOLID set, states that software should be open for extension and at the same time closed for modification.

He starts with a little background on the project, pointing out that there's a Session object it uses for all of its testing with a magic "__call" method that handles any kind of method call to the object. This method has issues (dependencies, strict requirements for use) but can be refactored according to the Open/Closed idea to set up an array of anonymous functions that can be called as a "command". Examples of these types of classes are also included (one for the "click" action on a button and another for getting the current location).

0 comments voice your opinion now!
open closed principle solid design command phpunit selenium



Community Events





Don't see your event here?
Let us know!


laravel zendserver development threedevsandamaybe community conference tips bugfix release code list deployment api series framework symfony introduction interview language podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework