We usually set up a WordPress website within an offline development environment and migrate it to the target webspace when it is finished. We are used to test everything thoroughly, but…

How do you quickly check if everything is allright, before you go “online”?
How can you check for potential compatibility errors after upgrading WordPress and/or plugins?
The answer is: Run automated HTML Unit Tests.

According to the rules of extreme programming, test-driven development the idea of unit tests is to always write the test before the actual functionality. For this post, I will sum up in 3 easy steps, how to adopt that concept for running automated checks on your blog without any programming!

Step 1

Most people use Firefox and Firebug as essential tools for webdevelopment. You are going to add one more great extension called Selenium-IDE. So these are you prerequisites:

HTML Unit Tests - Firefox HTML Unit Tests - Firebug Selenium-IDE

Step 2

Define some important functionality that should never break. For the purpose of this tutorial, we just check the search function of your blog:

  • Open you blog’s home page in Firefox
  • Start Selenium-IDE from Firefox’ extras menu. It will be in record mode by default.
  • Search any term on your blog.
  • Click the Selenium-IDE record button to stop recording your html unit test.

Step 3

Not hit the play button in Selenium-IDE, lean back and watch! I run these tests preferably with Firebug open. That way I can see whats going on.

That’s it! Now play around with Selenium and you’ll discover very quickly hundreds of situations where this tool will come in handy.

Notes

A few more hints what can be done with Selenium-IDE:

Need to run variations of one test?

Copy and paste the test commands within the table tab of Selenium-IDE. You can edit these commands and run the same test in different variations.

Need the same test for different blogs/installations?

Save generic tests changing the Base URL for more WordPress installations to check. I need to do this,to be able to run the same HTML Unit Tests at my production site that are running within my offline development environment.

Want to check User-level functionality?

Create a User on your blog just for the test environment. With Selenium-IDE you can record the whole process from logging in, posting content, editing content until logout.

Share This
  1. Abhishek Says:

    Selenium Test Runner is more useful than Selenium IDE for Functional Testing

Leave a Reply

For support questions, bug reports and troubleshooting regarding plugins from this site, please visit the forum.

See also:

Plugins in action: Mini-Slides

Turakraft uses Mini-Slides.

Plugins in action: Mini-Slides on timbuktoons.tv

Timbuktoons uses the Mini-Slides plugin.

This time it's Facebook

As being advised I did my Facebook page today ;)

Plugins in action: Find Us

KGALEWOOD, the Botswana Travel Community Podcast Channel uses Find Us.

Close
E-mail It