Screencast: SilverStripe Behaviour Testing Framework – GSoC 2012

Read more…

Introducing SilverStripeExtension for Behat

During the second phase of GSoC an idea came into my mind. Why not allow other developers test their SilverStripe modules behaviourally?

There was already an extension created for basic interactions with the temporary database, but it was not in the state where you would be able to use it outside of the Sapphire framework.

But that’s the thing of the past. Now, let me introduce you to the new, shiny SilverStripeExtension.

Read more…

AJAX callback support for Behat with Mink (and jQuery)

SilverStripe relies heavily on AJAX interactions with feedback times varying from 200ms to multiple seconds. In order to make testing both stable and fast we needed a more sophisticated system than fixed timeouts.

This has already been implemented for the old spec-by-example module.

Read more…

Using subcontexts with Behat and Mink

Using subcontexts with Behat and Mink is easy. You only need to remember to only extend MinkContext (or use Mink as subcontext) once, because it has some basic step definitions already defined and Behat doesn’t allow redundant step definitions.

Read more…

Conditional intercepting of redirections with Behat and Mink

In behat documentation, the topic of intercepting redirections is discussed in the context of using the profiler to test some of the features that hit specific browsers.

The solution proposed there has a specific drawback: it only works when you are trying to test using either goutte or symfony driver.

However, if some of the features you want to test using different driver too – like selenium2, that supports redirections, but does not allow to intercept them – you have to try different approach.

Read more…

Behat installation through PEAR

Do yourself a favour and don’t even think about doing it, just go with the Composer method. Don’t waste time, seriously.

Here’s why:

  1. It simply doesn’t work out-of-the box. I have tried it on two clean ubuntu installs (which you can find on EC2 instances) as well as on Mac OS X Lion.
  2. Most likely, you won’t get the latest version (2.3.5 vs 2.4.0 at the time of writing), which is crucial in such edge technologies.

Read more…

Specification by Example

Today, Ingo introduced me to this Specification by Example book by Gojko Adzic. In his opinion it should explain the high-level goals we want to achieve during this project.

Read more…

Improve Behaviour Testing Framework and Test Suite

On 22.05 the 2012 edition of Google Summer of Code started and I’m lucky to be one of the participants, working with SilverStripe!

Here is an excerpt from my project summary:

SilverStripe has a decent coverage of unit tests, but these tests test mostly backend and don’t examine the CMS/framework from the user perspective. The goal of the project is to introduce acceptance tests (simulate user behaviour in the system to check most common actions).

Read more…