Skip to main content

Articles tagged with "Testing"

A/B Testing with ABJS module

Nathan Page
5th Feb 2019

ABJS is a contrib Drupal module, and, without any requirements or ties to paid services, is as low cost as you can get. As we’ll see, it’s pretty basic but it really lets you get down to building your own understanding of how A/B testing works. The beauty of ABJS is in its simplicity. The settings pages are fairly self-explanatory, which is really helpful. Let’s set up a basic A/B test to show how things work.

Setting up our first experience

In our test, we’re going to split the site 50:50 in order to test an alternate homepage design. Go...

Read more

The options

Nathan Page
29th Jan 2019

If you need to do some A/B testing at minimal cost, this is our quick overview of the available options that we found.

There are some powerful free options, and some free trials for some superb products. As with all things, the free options come with limitations that mean that for some circumstances it may be totally worth paying up for the right product/service. Free is not always better, and paid is not always better! We leave the final decision and hard negotiation to you :)

##optimizely
Optimizely has a 30 day trial, then paid plans. No public pricing. Has...

Read more

Review driven development?

22nd Jan 2019

We've heard of test-driven development, behaviour-driven development, feature-driven development and someone has probably invented buzzword-driven development by now. Here's my own new buzzword phrase: review-driven development. At ComputerMinds, we aim to put our work through peer reviews to ensure quality and to share knowledge around the team. Chris has recently written about why and how we review our work. We took some time on our last team 'CMDay' to discuss how we could make doing peer reviews better. Here's some of our thoughts. Many of them are essentially answers to this question: Why is reviewing hard? How can we make it easier?

Read more

Peer Review

Chris Didcote
2nd Jan 2019

At ComputerMinds we like to think that we’re all pretty good at what we do; however, nobody is perfect and this is why we always ensure that our code is properly peer reviewed as part of our quality assurance process.

Peer review is literally just what the name implies; we work together to review each other’s code to make sure that it all makes sense. This approach means that we’re able to spot obvious mistakes before they become a problem. It also has the huge advantage of allowing us to transfer knowledge between our team on a day-to-day basis.

###Pull...

Read more

How to write a PHPUnit functional test for Drupal 8

Jo Fitzgerald
21st Jun 2016

This article will talk you through the steps to follow to write a simple PHPUnit functional (Kernel) test for Drupal 8.

I have been doing a lot of work on Drupal 8 migrations for the past few months so that will be the focus of the test.

Read more

A fully-automated testing rig #8

Nathan Page
12th Aug 2014

##Part 8: CasperJS debugging tips

You're getting desperate. Your CoffeeScript / Javascript syntax looks OK, but CasperJS doesn't like what you're giving it.

Try going through this checklist for a selection of sensible sanity checks and more:

  1. Is all your syntax actually correct? If you're using CoffeeScript, are your indents all correct? Like, all of them?
  2. Is the page actually there? Is the content actually published? Have a look in a real browser, make sure you're doing what you think you're doing.
  3. Is your selector correct? If you're using selectors or maybe running a this.evaluate statement, it's...
Read more

A fully-automated testing rig #7

Nathan Page
5th Aug 2014

##Part 7: When this.mouse.click doesn't work

mouse.click and mouse.move are a really helpfuls function in CasperJS, but we have at times found that they just don't work. Mostly, that's been because the element isn't there to click on. Do make sure that it's actually there! Make sure you're using the right selector, too. Try a casper.capture() to see whether it's there, but be wary of timings to ensure that you get a capture for the moment that you want to be performing the mouse action.

If all else fails, and in one test script nothing at all would work, then...

Read more

A fully-automated testing rig #6

Nathan Page
29th Jul 2014

##Part 6: Manually fail a test, but continue script execution

We set up an event to take screenshots of failed test pages, by hooking into the onFail event. This made for a problem when we wanted to pass or fail a test based on whether there were entries in the Drupal Watchdog table. Failing a test also would normally stop script execution, but we explicitly need our post script to finish its work!

CasperJS fortunately allows you both to pass and fail tests manually, and also to create your own events. We created a manual_fail event in our pre script...

Read more

A fully-automated testing rig #5

Nathan Page
22nd Jul 2014

##Part 5: Fun with viewports, and THEN some

As I described previously, we nicely externalised our list of viewport sizes, making it really easy to set our viewports for mobile, tablet and desktop tests. Our content appearance tests put this to good use, taking screenshots of the content at mobile, tablet and desktop resolutions. The problem we very quickly ran into was that we frequently ended up with empty screenshots, or sometimes no screenshot at all. This is where the asynchronous fun began.

The official walkthrough for CasperJS' "step stack" gives a very brief introduction to the idea that navigation...

Read more

A fully-automated testing rig #4

Nathan Page
15th Jul 2014

##Part 4: When TrueType doesn't fix everything

#####Two fonts walk into the bar, and the barman says, “Sorry lads, we don’t serve your type.”

It was a good day. I'd finished writing up the basic appearance tests for the first batch of content types, I'd road-tested them on my machine, we'd set up Jenkins… all was ready to go for our first run on the server. When we ran it, however, all the tests failed against the baseline.

Every single one.

Things started to get tense as it became clear that the solution was no trivial matter: we were experiencing...

Read more