mediawiki-extensions-Revisi.../tests/browser
addshore 1671a07d7d Allow browser tests to add more revisions easily
This allows an arbitrary number of revisions to be created
on a page very easily.
The page created will have a name relating to RevisionSlider
suffixed by a random float.

The base logic for this is taken from:
Ic165f108517c534a4b1c12883621b3624c7b0336

This patch also removes the @vagrant tags as RevisonSlider
is not yet in vragrant.
Please see T139296 for the ticket to add it.

Bug: T133278
Change-Id: I8a25db411bee2fa44555a23d1a840907a185c998
2016-07-04 14:58:14 +01:00
..
features Allow browser tests to add more revisions easily 2016-07-04 14:58:14 +01:00
environments.yml Start browser tests (Initial test for beta feature switch) 2016-06-30 14:46:37 +01:00
README.mediawiki Start browser tests (Initial test for beta feature switch) 2016-06-30 14:46:37 +01:00

To run the Selenium tests you will have to install Ruby (for the exact
version see Gemfile), the latest versions of RubyGems and Firefox.

The easiest way to install Ruby on *nix is RVM (https://rvm.io/) and on
Windows RubyInstaller (http://rubyinstaller.org/).

Open terminal in tests/browser. Update RubyGems and install required
gems with:

  gem update --system
  gem install bundler  # on Mac OS X Yosemite append ` --user-install -n~/bin`,
                       # where ~/bin is the install folder
  bundle install

Environment variables MEDIAWIKI_USER and MEDIAWIKI_PASSWORD are required for
tests that require a logged in user. For local testing, create a test user on your local wiki
and export the user and password as the values for those variables.
For example:

  export MEDIAWIKI_USER=<username here> # Linux/Unix/Mac
  set MEDIAWIKI_USER=<username here> # Windows

  export MEDIAWIKI_PASSWORD=<password here> # Linux/Unix/Mac
  set MEDIAWIKI_PASSWORD=<password here> # Windows

In addition to this create another user which will be reserved for new uploads
"Selenium_newuser". The password for this user should be the same as
MEDIAWIKI_PASSWORD

Tests that use the "Given I create a random page using the API" step need to set
the MEDIAWIKI_API_URL environment variable, e.g.
export MEDIAWIKI_API_URL=http://en.wikipedia.beta.wmflabs.org/w/api.php

Run the tests from the RevisionSlider tests/browser directory with:

  bundle exec cucumber

If you want to run a single set of tests, go to the tests/browser directory and
call 'bundle exec cucumber' with the path to the test file. For example, to run
only the watchlist tests:

  bundle exec cucumber features/betafeature.feature

XML report (for Jenkins) is created at tests/browser/reports/junit.

Jenkins is hosted at https://wmf.ci.cloudbees.com/ and it drives
browsers at http://saucelabs.com/

For more information about running Selenium tests please see
https://github.com/wikimedia/mediawiki-selenium