Selenium/Getting Started/Run tests targeting Beta cluster

For this example, we will target English Wikipedia at the Beta Cluster.



Advantages

 * You do not have to install or learn how to use a local development environment like MediaWiki-Docker.
 * It will be reasonably fast. MediaWiki Core Selenium test run takes about 5 minutes on my machine. A lot of tests fail. Subset of passing tests takes about 1 minute. (As of September 2019.)
 * Debugging failed tests will be easier, since you are able to see the browser. See Selenium/How-to/Make the browser visible for more information.

Disadvantages

 * You will need internet connection while running the tests.
 * The tests will be slower since the target machine is not local.
 * You will have to install Selenium and it's dependencies on your machine.

Clone MediaWiki Core
There are several ways to clone the MediaWiki Core. In this example, will use  since it is the simplest. You can skip this step if you already have MediaWiki Core cloned.

Install dependencies
Depending on your operating system, installing dependencies will be different.

Browser

 * Install Google Chrome or Chromium.

Node.js

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

Environment variables
Ensure the following environment variables are set. Either run this manually from the terminal or, to make it easier for next time, set them from shell configuration file (, ...) which means the variables are always available from any terminal session:

If you prefer, you can create an  file instead (in MediaWiki Core folder), with this contents.

Replace  and   with your username and password.

Run the Selenium tests
Run all tests.

Please note that a lot of tests will fail. Tests are written for targeting MediaWiki on a Jenkins worker machine and MediaWiki-Vagrant virtual machine.

If you would like to run a subset of passing tests, run these commands in separate terminal windows or tabs.