Selenium/Ruby/Setup instructions

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

User
Create a user on the test server (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 12.10 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 one or more roles.

Now run  to boot the virtual machine

Then run. Access the virtual machine with. The code will be located at. Let the virtual machine know that you want to run tests at en.wikipedia.beta.wmflabs.org with ..

Example of setting up vagrant in Terminal:

$ git clone https://gerrit.wikimedia.org/r/mediawiki/vagrant $ cd vagrant $ vagrant up $ vagrant provision $ vagrant ssh -- -X $ cd /srv/browsertests $ export MEDIAWIKI_URL=http://en.wikipedia.beta.wmflabs.org/wiki/

Browser
Install Firefox (if you do not already have it installed).

Ruby on Windows
Tested on Windows 7 Enterprise, Service Pack 1, 32-bit.

Download Ruby 1.9.3-p429 and DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe from RubyInstaller.

Install Ruby. You can leave all settings at default values, except at the Installation Destination and Optional Tasks screen check Add Ruby executables to your PATH checkbox.

Extract DevKit to  and set it up from Command Prompt:

C:\>cd devkit

C:\devkit>ruby dk.rb init [INFO] found RubyInstaller v1.9.3 at C:/Ruby193

Initialization complete! Please review and modify the auto-generated 'config.yml' file to ensure it contains the root directories to all of the installed Rubies you want enhanced by the DevKit.

C:\devkit>ruby dk.rb install [INFO] Updating convenience notice gem override for 'C:/Ruby193' [INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'

Ruby on Mac
Tested on OS X 10.8.4.

Mac machines come with Ruby installed, but unfortunately, it is an old version (1.8.7). To run the tests you will need a more recent version of Ruby (1.9.3 or 2.0).

Download and install Command Line Tools (OS X Mountain Lion) for Xcode - April 2013 from developer.apple.com.

Install Ruby Version Manager (RVM) by running this in Terminal.

Open a new Terminal window or tab and install Ruby:

Ruby on Linux
Tested on Ubuntu 13.04 32-bit.

To configure Terminal to work with RVM: Terminal > Edit > Profile Preferences > Title and Command > Run command as a login shell > check > close. For more information see Integrating RVM with gnome-terminal.

Install curl by opening Terminal application and typing this:

Install Ruby Version Manager (RVM):

Open a new Terminal window or tab and install Ruby:

Code
Clone qa/browsertests Gerrit repository.

Install required Ruby software
Open Terminal (Mac, Linux) or Command Prompt (Windows) application and type this. is the name of the folder where the code is located.

$ cd browsertests $ gem update --system $ gem install bundler $ bundle install

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


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