Selenium/Ruby/Setup instructions

Setup
Please setup either a virtual machine or your computer for browser testing.

User
Create an account on beta labs if you don't already have one.

Git
Create Gerrit account. Creating GitHub accounts is optional, but recommended.

On Mac install GitHub for Mac. Run the Github app and at Configure Git step of the startup wizard click Install Command Line Tools button.

On Ubuntu install it with.

On Windows install GitHub for Windows. After the installation Git Shell shortcut will appear on your desktop. Clicking the shortcut will open command line with Git configured.

Setup virtual machine
Tested on OS X 10.8.4 and Ubuntu 13.04 64-bit.

The easiest way to set everything up is to use MediaWiki-Vagrant virtual machine.

If you have Git installed, follow the instructions in Quick start section. If you do not have Git installed (instead of  step) get the code from wikimedia/mediawiki-vagrant Github repository, just click Download ZIP button.

In addition to the instructions there, on OS X you will need to install the latest version of XQuartz

Run  to see the available roles then use   command to enable the   role. This will set up Ruby and check out the browsertests for "core" MediaWiki features.

Now run  to boot the virtual machine

Then run. Access the virtual machine with. The browser tests for "core" MediaWiki features will be in.

Example of setting up vagrant in Terminal:

$ git clone https://gerrit.wikimedia.org/r/mediawiki/vagrant $ cd vagrant $ vagrant enable-role browsertests $ vagrant up $ vagrant provision $ vagrant ssh -- -X $ cd /srv/browsertests

Setup your computer
You will need a few things setup in order to run the browser tests for MediaWiki.

Browser
Install Firefox (if you do not already have it installed). Firefox is required for the browser automation tool Selenium.

Selenium
A web browser automation tool, Selenium is a FIrefox add-on that allows you to automate actions within your browser.

Install Selenium IDE from http://www.seleniumhq.org/projects/ide/

Ruby
To run the Selenium tests you will have to install Ruby. Look at the  file in the code below for the exact required version. You also have to install the latest versions of RubyGems and Firefox (the default browser in which the tests run).

The easiest way to install Ruby on Linux/Unix/Mac is RVM and on Windows RubyInstaller.

Code
Grab the Rub gem for MediaWiki Selenium.

git clone https://gerrit.wikimedia.org/r/mediawiki/selenium

Or, if you prefer, grab a copy from our github mirror

From there, follow the directions located in the README.md], which covers installation and usage.

Setup for testing with other browsers
It is possible to run tests with other browsers(Chrome, PhantomJS) by exporting BROWSER environment variable.


 * Chrome
 * Install Chrome
 * Install ChromeDriver
 * PhantomJS
 * Install PhantomJS

Getting help
Discussion is always welcome on the IRC channel #wikimedia-qa on freenode. Also, the QA mail list welcomes subscribers.