mediawiki-extensions-Popups/tests/selenium
Antoine Musso 1cff4a15a7 QA: Selenium no more needs wgUsejQueryThree
$wgUsejQueryThree was a transient setting that has been removed with
MediaWiki 1.31.  It is thus no more needed in the Selenium
LocalSettings.php file.

Bug: T199939
Change-Id: I74565cc81ff3704d2d91c8768b0e8f8ee7a4dcc3
2018-07-19 15:57:47 +02:00
..
fixtures Port Popups browser tests to selenium 2017-11-01 13:31:36 -07:00
pageobjects Doc: update some of the popups / preview terminology 2018-03-23 11:18:26 +01:00
specs Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
.eslintrc.json Clean up ESLint configuration 2017-12-22 16:12:54 +01:00
README.md Update README file for Selenium tests 2018-02-27 14:04:39 +01:00

Selenium tests

Please see tests/selenium/README.md file in mediawiki/core repository, usually at mediawiki/vagrant/mediawiki folder.

Setup

Set up MediaWiki-Vagrant:

cd mediawiki/vagrant
vagrant up
vagrant roles enable popups
vagrant provision
cd mediawiki
npm install
echo 'include_once "$IP/extensions/Popups/tests/selenium/LocalSettings.php";' >> LocalSettings.php

Start Chromedriver and run all tests

Run both mediawiki/core and extension tests from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):

npm run selenium

Start Chromedriver

To run only some tests, you first have to start Chromedriver in one terminal tab (or window):

chromedriver --url-base=wd/hub --port=4444

Run test(s) from one file

Then, in another terminal tab (or window) run this from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):

./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec extensions/EXTENSION-NAME/tests/selenium/specs/FILE-NAME.js

wdio is a dependency of mediawiki/core that you have installed with npm install.

Run specific test(s)

To run only test(s) which name contains string TEST-NAME, run this from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):

./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec extensions/EXTENSION-NAME/tests/selenium/specs/FILE-NAME.js --mochaOpts.grep TEST-NAME

Make sure Chromedriver is running when executing the above command.