Selenium/How-to/Run tests targeting MediaWiki-Vagrant
< Selenium | How-to(Redirected from Selenium/Getting Started/Run tests targeting MediaWiki-Vagrant)Jump to navigation Jump to search
For this example, we will not enable any roles and we will use MediaWiki core.
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
DISPLAYenvironment variable. See README.md for more information.
- You are probably already familiar with MediaWiki-Vagrant and have it installed.
- 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 Vagrant, MediaWiki-Vagrant and their dependencies on your machine.
Set up MediaWiki-Vagrant
- Follow instructions at MediaWiki-Vagrant.
Boot the machine
$ vagrant up
$ cd mediawiki
Depending on your operating system, installing dependencies will be different.
- Install Node.js.
- Install required npm packages.
$ npm ci
Run Selenium tests
npm run selenium
halt the machine
$ vagrant suspend ==> default: Saving VM state and suspending execution...
$ vagrant halt ==> default: Attempting graceful shutdown of VM...