Selenium/Getting Started/Run tests targeting MediaWiki-Docker

For this example, it is assumed you have a custom MediaWiki install. This tutorial will use addshore/mediawiki-docker-dev as an example custom MediaWiki install. If you have a different setup, you will only need to change a few environment variables.

Advantages
Running Selenium tests targeting custom MediaWiki installation has several advantages:


 * It will be fast, since the target machine is local.
 * MediaWiki core Selenium test run takes less than 20 seconds on my machine.
 * It takes about 2-3 minutes for mediawiki-core-qunit-selenium-jessie Jenkins job to run.
 * After everything is set up, you do not need an internet connection.
 * Debugging failed tests will be easier, since you will see the browser.
 * You already have a custom MediaWiki install.

Disadvantages

 * You will have to install MediaWiki, Selenium and their dependencies on your machine.

Set up MediaWiki

 * You have already installed it. In this example, we will use addshore/mediawiki-docker-dev setup.

Go to folder
It's at  on my machine.

Install dependencies
You will need internet access for this step. Depending on your operating system, installing dependencies will be different.

Chrome

 * Install Chrome.
 * Download ChromeDriver and put it in a folder included in.

Node.js

 * Install Node.js.
 * Install required npm packages.

Run Selenium tests
The usual command to run the tests is. It will probably fail, because it assumes MediaWiki is set up by MediaWiki-Vagrant. All you need to do is to set up a few environment variables.