mediawiki-extensions-Echo/tests/selenium
Željko Filipin 6aa871293e Use new page objects from mediawiki/core in Selenium tests
Bug: T171848
Change-Id: Ib6a08c6a34ef6a4bef8a81f49fed8aae67dc67dc
2018-06-22 15:23:23 +00:00
..
pageobjects Use new page objects from mediawiki/core in Selenium tests 2018-06-22 15:23:23 +00:00
specs Use new page objects from mediawiki/core in Selenium tests 2018-06-22 15:23:23 +00:00
.eslintrc.json selenium: Make it possible to run tests from Echo folder 2018-06-22 14:17:05 +00:00
README.md Update README file for Selenium tests 2018-02-27 13:57:52 +01:00
wdio.conf.js selenium: Make it possible to run tests from Echo folder 2018-06-22 14:17:05 +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 echo
vagrant provision
cd mediawiki
npm install

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.