wiki.techinc.nl/tests/selenium
Bartosz Dziewoński bde7249241 selenium: Remove '☃' character (U+2603 snowman emoji) from random usernames
The AntiSpoof extension disallows this character in usernames, causing
tests to fail on some setups. Its error message claims it is an
"unassigned character" (which is false), but it seems it's
intentionally disallowed and the error message should instead say
"non-script character" or something.

Bug: T198384
Change-Id: Ia8e7b425b6a3cf3742c00178f28c97a19f46bab0
2018-06-29 16:58:36 +02:00
..
pageobjects Merge "Add browser test for basic watchlist functionality" 2018-06-25 09:49:02 +00:00
specs Browser tests: use Util.getTestString in specialwatchlist.js 2018-06-25 12:14:25 +02:00
wdio-mediawiki selenium: Remove '☃' character (U+2603 snowman emoji) from random usernames 2018-06-29 16:58:36 +02:00
.eslintrc.json selenium: Run wdio directly without grunt 2018-04-30 21:54:15 +00:00
README.md selenium: Initial version of wdio-mediawiki package 2018-05-09 14:43:30 +00:00
selenium.sh Use wd/hub not /wd/hub in selenium.sh 2018-06-13 11:56:15 +00:00
wdio.conf.js Selenium: run Wikibase repo tests 2018-06-19 17:04:09 +02:00

Selenium tests

Prerequisites

If using MediaWiki-Vagrant:

cd mediawiki/vagrant
vagrant up

Installation

cd mediawiki
npm install

Usage

npm run selenium

By default, Chrome will run in headless mode. If you want to see Chrome, set DISPLAY environment variable to any value:

DISPLAY=1 npm run selenium

To run only one test (for example specs/page.js), you first need to start Chromedriver:

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

Then, in another terminal:

npm run selenium-test -- --spec tests/selenium/specs/page.js

You can also filter specific cases, for ones that contain the string 'preferences':

npm run selenium-test -- tests/selenium/specs/user.js --mochaOpts.grep preferences

The runner reads the configuration from wdio.conf.js. The defaults target a MediaWiki-Vagrant installation on http://127.0.0.1:8080 with a user "Admin" and password "vagrant". Those settings can be overridden using environment variables:

  • MW_SERVER: to be set to the value of your $wgServer
  • MW_SCRIPT_PATH: ditto with $wgScriptPath
  • MEDIAWIKI_USER: username of an account that can create users on the wiki
  • MEDIAWIKI_PASSWORD: password for above user

Example:

MW_SERVER=http://example.org MW_SCRIPT_PATH=/dev/w npm run selenium

Further reading