wiki.techinc.nl/tests/selenium
Željko Filipin f195a217b4 Selenium: update WebdriverIO configuration
No changes are made to the configuration file. It has just been
regenerated with the latest WebdriverIO version. Minor whitespace
cleanup has been made to the file after it has been generated so it
conforms to our ESLint configuration.

This is the first step in updating configuration so videos of failed
tests are recorded.

Bug: T179188
Change-Id: Id0db3743ae7d828357b1527770bb7dcd2e02f99b
2018-03-30 17:29:47 +02:00
..
pageobjects Merge "Selenium: Replace nodemw with mwbot" 2018-03-21 15:17:06 +00:00
specs Revert "selenium: add new message banner test to user spec" 2018-01-29 20:41:21 +00:00
.eslintrc.json ESLint ecmaVersion setting is not needed if env is es6 2017-11-15 14:27:13 +01:00
README.md Update README file for Selenium tests 2018-02-21 12:28:49 +01:00
wdio.conf.jenkins.js Selenium: Do not run CirrusSearch smoke tests in Jenkins 2018-03-21 12:18:00 +00:00
wdio.conf.js Selenium: update WebdriverIO configuration 2018-03-30 17:29:47 +02:00

Selenium tests

Prerequisites

Set up MediaWiki-Vagrant:

cd mediawiki/vagrant
vagrant up

Installation

cd mediawiki
npm install

Usage

npm run selenium

To run only one file (for example page.js), you first need to spawn the chromedriver:

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

Then in another terminal:

cd tests/selenium
../../node_modules/.bin/wdio --spec specs/page.js

To run only one test (name contains string 'preferences'):

../../node_modules/.bin/wdio --spec specs/user.js --mochaOpts.grep preferences

The runner reads the config file wdio.conf.js and runs the spec listed in page.js.

The defaults in the configuration files aim are targeting 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