Selenium Testcases

From MediaWiki extension testing
Jump to: navigation, search

We have started using Selenium for testcases of the interface, for example special pages or enhancements to the edit page. They provide a great deal more accuracy than our regular manual testcases and can be adapted to satisfy a variety of situations.

Contents

Types of Testcase

At the moment there are two main types of Selenium testcase.

Semi-automated
These simply run and observed, the tester can make observations regarding whether the correct behaviour is ocurring (required observations would be defined on wiki pages). If the page is malformed on a large scale then Selenium may report that it cannot complete the testcase, this could also be reported (however it would be wise to attempt to override the issue if the rest of the test can proceed without that stage).
Fully automated
The tests perform checks for content within the page, and output the results to the tester. Observations could also be made in conjunction with this, however it is better to separate them to ensure more comprehensive results - these two categories will often have entirely different purposes when testing.

Installing Selenium

Tests are run and developed using the extension for Mozilla Firefox called Selenium IDE, this can be installed directly from your browser from SeleniumHQ. Tests can be carried out in different browsers using Selenium RC, however this will often have different purposes and is a more advanced use.

Obtaining Testcases

Selenium testcases are linked to from extension test report pages, they are tied together in sets so only one Selenium testcase file is required per an extension.

Running Testcases

Once you have some testcases on your computer, run Selenium from the Tools menu in Firefox; then open the test case, or test case set, you want to run from File > Open. Base URL should be set to the directory your wikis index.php file is in. For example, if your index.php is located at http://12.wikiation.nl/revisions/T/index.php then Base URL should be http://12.wikiation.nl/revisions/T/.

If there is only one testcase, you can press the play button to run it - at any point you can press pause and step through it line by line. When multiple testcases are present you can either run them individually or all in a sequence.

It is important to remember that many testcases will be influenced by whether or not other extensions are installed, so when running testcases you should only have the extensions that testcase has been made for installed.

Language

When the language for a test case is not the same, the test will fail! It is therefore essential to standardise on the same language.

Developing Testcases

Some notes for when you are developing testcases:

Server info

The same extension with the same testcase still may lead to a different result because it it run on a different server. Retrieve server info from external source is needed which might be relevant.

Personal tools
Namespaces
Variants
Actions
navigation
Toolbox