Selenium/Getting Started/Run tests using Fresh

This page describes how to run Selenium tests locally against your own MediaWiki install.

Note that if you use MediaWiki-Vagrant, there is a dedicated page for running Selenium Node.js on MediaWiki-Vagrant.

Advantages
Compared to other ways of running the Selenium tests:


 * Local tests complete much quicker (typically under a minute, as opposed to 5-10 min through Jenkins).
 * Works without an internet connection.
 * Doesn't require installing ChromeDriver or FFmpeg (compared to bare installs).
 * Doesn't require executing npm packages directly on your machine (which is scary).

Disadvantages

 * You need to have Docker installed.

Prerequisites

 * Local MediaWiki installation. For example using mediawiki-docker-dev.
 * Docker. See Docker CE for Linux, Docker for Mac, or Docker for Windows.
 * Install the Wikimedia Fresh CLI for Docker.

Run Selenium tests
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 a  file which means the variables are always available from any terminal session: Next, navigate to where you have the MediaWiki core repository and start a Fresh session (let it see environment variables, and grant networking to access for your MediaWiki install): The first time (or after updating MediaWiki), install the npm packages used by MediaWiki's browser tests: And finally, run the tests: