2017-02-14 16:05:08 +00:00
|
|
|
# Selenium tests
|
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
Please see tests/selenium/README.md file in mediawiki/core repository, usually at mediawiki/vagrant/mediawiki folder.
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
## Setup
|
2017-02-14 16:05:08 +00:00
|
|
|
|
|
|
|
Set up MediaWiki-Vagrant:
|
|
|
|
|
|
|
|
cd mediawiki/vagrant
|
|
|
|
vagrant up
|
|
|
|
vagrant roles enable mobilefrontend relatedarticles
|
|
|
|
vagrant provision
|
2018-02-27 13:06:22 +00:00
|
|
|
cd mediawiki
|
|
|
|
npm install
|
2017-12-19 12:46:47 +00:00
|
|
|
echo 'include_once "$IP/extensions/RelatedArticles/tests/selenium/LocalSettings.php";' >> LocalSettings.php
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
## Start Chromedriver and run all tests
|
|
|
|
|
|
|
|
Run both mediawiki/core and extension tests from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):
|
2017-02-14 16:05:08 +00:00
|
|
|
|
|
|
|
npm run selenium
|
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
## 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
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
`wdio` is a dependency of mediawiki/core that you have installed with `npm install`.
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
## Run specific test(s)
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
To run only test(s) which name contains string TEST-NAME, run this from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec extensions/EXTENSION-NAME/tests/selenium/specs/FILE-NAME.js --mochaOpts.grep TEST-NAME
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2018-02-27 13:06:22 +00:00
|
|
|
Make sure Chromedriver is running when executing the above command.
|