wiki.techinc.nl/tests/selenium
Željko Filipin 86b867f794 Make running Selenium tests using Sauce Labs easy
If SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are not
defined, tests are run with `npm run selenium`, as usual.

https://www.mediawiki.org/wiki/Selenium/Node.js/Inside_MediaWiki-Vagrant
https://www.mediawiki.org/wiki/Selenium/Node.js/Target_MediaWiki-Vagrant

If the environment variables are defined, to run tests using Sauce Labs
and targeting Beta Cluster, run this:

```
export SAUCE_USERNAME=***
export SAUCE_ACCESS_KEY=***
export MW_SERVER=https://en.wikipedia.beta.wmflabs.org
./node_modules/.bin/wdio tests/selenium/wdio.conf.js
```

https://www.mediawiki.org/wiki/Selenium/Node.js/Target_beta_cluster_using_Sauce_Labs

Bug: T139740
Change-Id: I622d9c55ae595ab772e733388d209623e3a9f81e
2017-05-25 15:57:04 +00:00
..
pageobjects
specs
.eslintrc.json build: Update eslint to 0.4.0 and make pass 2017-05-04 22:38:03 +00:00
README.md
wdio.conf.jenkins.js
wdio.conf.js Make running Selenium tests using Sauce Labs easy 2017-05-25 15:57:04 +00: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 mediawiki/tests/selenium
../../node_modules/.bin/wdio --spec page.js

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 targetting a MediaWiki-Vagrant installation on installation on http://127.0.0.1:8080 with a user Admin and password 'vagrant'. Those settings can be overriden 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