328 Results
  • Latest
  • Oldest
Article
Posted on 5th August 2014
Takes about 1 min to read

##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...

Published in: #Testing
Article
Posted on 29th July 2014
Takes about 1 min to read

##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...

Published in: #Testing
Article
Posted on 22nd July 2014
Takes about 1 min to read

##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...

Published in: #Testing
Article
Posted on 15th July 2014
Takes about 2 mins to read

##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...

Published in: #Testing
Article
Posted on 8th July 2014
Takes about 2 mins to read

Part 3: Using other scripts, datasources and directories Earlier I described a bit about the scope of the project and how careful planning would be needed to keep the project growing smoothly. One result of this is our test template - a basic test script outline which most scripts should stick to - which makes test scripts easier to update because they all follow the same structure (yay standardisation!). The template neatly gets most...

Published in: #Testing
Article
Posted on 2nd July 2014
Takes about 1 min to read

##Part 2: Setting up for a large project When you take on a project it's a good idea to make sure you plan ahead. Testing platforms only remain useful as long as they're considered dependable - if it becomes too difficult to write tests which don't reliably execute you might as well not bother. Here are a few key things I set up at the start to help the project along, which have all been...

Published in: #Testing
Article
Posted on 1st July 2014
Takes about 1 min to read

A quick introduction A few months ago I started my first project with CasperJS and PhantomCSS, and what an interesting experience it has been working through that to now our second, larger, automated testing setup. Being young projects, there are some fun quirks and niggles in CasperJS and PhantomCSS that I wish the world could have warned me about. I'm working on an automated testing rig that will politely inform our team members when...

Published in: #Testing
Article
Posted on 10th June 2014
Takes about 2 mins to read

When you are going to have multiple language set up on your Drupal site, it's important to set the default language appropriately before creating content. Once that is set, content will normally be set to be in that language, and any translations made on the site will be assumed to be from the default language as the source. So changing it is not a good idea, as there's no way to differentiate between translations made before and after the switch in Drupal 6 or 7! (This has been resolved in Drupal 8.) So, once you've thought first about what is necessary for your multilingual site, the next step is to pick the right default language, ideally before setting up anything else, as everything is 'in' a language in some way. It's usually an obvious choice, but did you know that the Drupal software itself and associated modules (i.e. the codebase, referred to as the ' interface') is all written in U.S. English (as per the coding standards)?

Article
Posted on 16th May 2014
Takes about 2 mins to read

Architecture has to be carefully thought through before implemented, or it could all come crashing down at an unexpected moment. You may not realise it, but language is a piece of architecture in all websites. Site builders will be used to thinking about how best to model content, usually in terms of content types, fields and vocabularies on Drupal sites. Every piece of text is modelled somehow - and every piece of text is written in some language. As soon as it matters which language that is - so that translations can be associated with each other and shown beside or instead of one another - that content model needs to incorporate language.

Article
Posted on 24th March 2014
Takes about 1 min to read

I recently got the chance to implement Drupal's multilingual capabilities on a major client site. Drupal has some of the best functionality around for localizing & translating a site, but it does take quite a lot to understand & configure. We will host a series of articles on this, entitled 'language lessons', starting on ... how to get started! Getting started with multilingual Drupal 7 The first places to visit when getting started with languages...