Selenium tests in Node.js using WebdriverIO
authorŽeljko Filipin <zeljko.filipin@gmail.com>
Mon, 19 Dec 2016 16:39:29 +0000 (17:39 +0100)
committerŽeljko Filipin <zeljko.filipin@gmail.com>
Tue, 14 Mar 2017 11:20:32 +0000 (12:20 +0100)
commit7aee98758a97cde1e111297b2e3706544d3fe2c8
treed612eaa8560eaec118d2200b7b7571927794714d
parent1949b15d1a762464186c7ce658a6a9d3c33cab06
Selenium tests in Node.js using WebdriverIO

Introduce the WebdriverIO browser testing framework driven by Node.js.
The overall intents are:
* have MediaWiki core to provide a platform to run tests that is shared
  between core and the extensions.
* phase out ruby driven browser tests eventually.

Code is namespaced in sub directory /tests/selenium
The 'pages' sub directory provides helper representing a MediaWiki page
such as Special:Login and human friendly helpers to interact with the
elements.

Add Grunt task webdriver:test.

Provide a npm script to easily spawn/dispose chromedriver and run above
grunt task.

wdio.conf.js provides all the configuration. It defaults to point to a
MediaWiki-Vagrant installation on http://127.0.0.1:8080. Can be
overriden with environment settings as needed.

glob patterns (specs) are made absolute paths from MediaWiki root path
that let us run the tests either from the root path (eg the npm
wrapper or from the tests/selenium directory when invoking wdio
directly. wdio assumes they are relative to the current working
directory, hence the normalization.

wdio.conf.jenkins.js extends the configuration and is used solely for
Jenkins.  The switch is done from the Gruntfile.js whenever JENKINS_HOME
is set.  Specially we want junit reports to be generated.

Provide a more specific eslint configuration.

References:

* MALU https://phabricator.wikimedia.org/source/malu/
* T151442 Research WebdriverIO
* T151443 Research Nightwatch.js

Bug: T139740
Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: Ibe7a004a120e82af637ab3e31b725de743134c99
15 files changed:
Gruntfile.js
package.json
tests/selenium/.eslintrc.json [new file with mode: 0644]
tests/selenium/README.md [new file with mode: 0644]
tests/selenium/pageobjects/createaccount.page.js [new file with mode: 0644]
tests/selenium/pageobjects/edit.page.js [new file with mode: 0644]
tests/selenium/pageobjects/history.page.js [new file with mode: 0644]
tests/selenium/pageobjects/page.js [new file with mode: 0644]
tests/selenium/pageobjects/preferences.page.js [new file with mode: 0644]
tests/selenium/pageobjects/userlogin.page.js [new file with mode: 0644]
tests/selenium/pageobjects/userlogout.page.js [new file with mode: 0644]
tests/selenium/specs/page.js [new file with mode: 0644]
tests/selenium/specs/user.js [new file with mode: 0644]
tests/selenium/wdio.conf.jenkins.js [new file with mode: 0644]
tests/selenium/wdio.conf.js [new file with mode: 0644]