mediawiki-extensions-Popups/tests/selenium
WMDE-Fisch 5a38638388 Fix module load script and remove pause
I just realized on another test set, that this is actually not implemented
in a way where it is working correctly. The return value of the browser.exectue()
is returned as part of an object and not directly. So the condition was always
true and the wait until did not really wait for anything.

As a result I'm quite confident the pause is not necessary.

Change-Id: I274bdee0b3c39c418a2b61881d56f89889c53485
2019-04-08 21:17:53 +02:00
..
fixtures Add test for dwelling reference links inside a reference preview 2019-03-25 12:37:05 +00:00
pageobjects Fix module load script and remove pause 2019-04-08 21:17:53 +02:00
specs Move browser tests loading steps to beforeEach 2019-04-05 15:56:16 +00:00
.eslintrc.json Avoid exception when checking for loaded modules 2019-04-08 19:51:11 +02:00
README.md Update README file for Selenium tests 2018-02-27 14:04:39 +01:00
wdio.conf.js Selenium: add selenium-daily NPM script 2018-09-05 19:16:12 +00: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.