Extension:Selenium

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
Selenium

Release status: beta

Implementation Tag, Special page
Description Provide a selenium tag and special page interface to selenium-core
Author(s) User:Zven
Latest version 0.8.4 (10 January 2008)
MediaWiki 1.12.0+
License GPL
Download
Example Selenium example

Translate the Selenium extension if possible

Check usage and version matrix; code metrics
Warning Warning: This extension is no longer under development, please see Selenium Framework for more active work involving the Selenium testing suite

Selenium is an extension which provides a tag <selenium> that encapsulates any selenium tests. For example, tests generated using selenium-ide (an extension available for the Firefox web browser). This allows mediawiki to act as a repository for maintaining selenium tests in articles. A wiki article that is a single selenium test is distinctly different from an article which contains a suite of selenium tests separated by section headings (==Section 1== etc).

This extension comes bundled with selenium-core (version 0.8.3), a test tool for web applications. The extension provides a special page (Special:Selenium) as an interface to allow a suite of selenium tests provided within an article to be parsed and run with selenium-core on the same server. When an article contains a selenium tag, it is automatically categorized into Category:Selenium. The Special page Special:Selenium provides a drop down list of selenium test suites to run using selenium-core.

This allows client side testing and validation of content on the server that the extension is installed on. For example, selenium-ide tests could be written to prove that a certain extension has been installed by checking for extension credits in Special:Version, and generate some content in the Sandbox that illustrates functionality and checks returned output for certain expected criteria. The Selenium-core environment will determine which tests have passed or failed.

Installation[edit | edit source]

Download the file Selenium.zip and unpack it in;

$IP/wiki/extensions

The structure should be as follows;

$IP/wiki/extensions/Selenium/Selenium.php
$IP/wiki/extensions/Selenium/selenium-core-0

To enable the extension add the following line into your LocalSettings.php.

include("$IP/extensions/Selenium/Selenium.php");

Check the extension is installed at Special:Version on your wiki site.

Alternatively you can separately download selenium-core-0 and the extension file Selenium.php and recreate the directory structure above.

Usage[edit | edit source]

The <selenium> tag encapsulates an entire generated selenium-ide test without having to remove any of the generated tag content. Adding the following CSS code to MediaWiki:Common.css will configure the displayed tables to look like selenium tests within wiki articles

div.selenium table {
border:1px solid #CCCCCC;
border-collapse:collapse;
font-family:Verdana,Arial,sans-serif;
font-size:12px;
Orginal website for Selenium is 
<ref>http://seleniumhq.org</ref>
}

Known issues[edit | edit source]

  • Parameters are not expanded in transcluded articles.
  • If <selenium> tags encapsulate multiple tests within a single section heading, only the first selenium tags within section headings are used to generate a suite used by the special page.
  • Currently there is no logging of users who run a selenium-core suite from a wiki article.

See also[edit | edit source]