Selenium/How-to/Run tests targeting MediaWiki-Vagrant

For this example, we will not enable any roles and we will use MediaWiki core.

Advantages
Running Selenium tests targeting MediaWiki-Vagrant machine has several advantages:


 * It will be fast, since the target machine is local. MediaWiki core Selenium test run takes about 2 minutes on my machine. (As of September 2019.)
 * After everything is set up, you do not need internet connection.
 * Debugging failed tests will be easier, since are able to see the browser using  environment variable. See README.md for more information.
 * You are probably already familiar with MediaWiki-Vagrant and have it installed.

Disadvantages

 * You might not be familiar with MediaWiki-Vagrant, so you will have to learn how to install and use yet another tool.
 * You will have to install MediaWiki-Vagrant, Selenium and their dependencies on your machine.

Set up MediaWiki-Vagrant

 * Follow instructions at MediaWiki-Vagrant.

Go to test folder
if you want to run tests for mediawiki folder or if you want to run tests for any extension

Install dependencies
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.

For tests in extensions
Run Chromedriver in one terminal window: Run Selenium tests in another terminal window:

or the machine
or