MinervaNeue/tests/browser
jdlrobson 4b4e9d6399 Minerva should use the MobileFrontend eventBusSingleton
The talk overlay is created inside MobileFrontend, but the
overlay for creating a new talk overlay is here.

The two need to speak to either other - in particularly, the create
talk overlay must invalidate the current talk page before returning
the user to the former.

In preparation for the refactoring changes in MobileFrontend, the
same object is shared and the cache invalidation is moved here since
Minerva creates and manages the PageGateway instance that is given
to the talk overlay.

Additional change:
* Update a selector broken by changes in
I8c34646b7ba13a26facbb69684e65109870d27a1

Bug: T217102
Change-Id: I212ff044c4c608c6ea60a5fda043166cd434ec1f
2019-03-06 12:33:36 -08:00
..
features Minerva should use the MobileFrontend eventBusSingleton 2019-03-06 12:33:36 -08:00
LocalSettings.php QA: Page issues browser test is ready for new treatment 2018-11-20 23:38:04 +00:00
README.mediawiki Hygiene: Remove and update references to MobileFrontend 2017-07-19 14:21:50 -07:00
ci.yml Port browser tests from MobileFrontend to Minerva 2017-07-11 14:11:03 -07:00
environments.yml Port browser tests from MobileFrontend to Minerva 2017-07-11 14:11:03 -07:00

README.mediawiki

= Git history =
Browser tests were migrated here from MobileFrontend.
For any git history prior to the migration, please review the git history of MobileFrontend (see https://gerrit.wikimedia.org/r/364325).

= Setup =
Include the LocalSettings.php in this folder into your MediaWiki LocalSettings.php.
Note including this in a production instance is not advised given it fiddles with permissions.

<pre>
include_once "$IP/skins/MinervaNeue/tests/browser/LocalSettings.php";
</pre>

Further tweaks may be necessary to run tests that are not tagged @integration:
* Ensure you have [//www.mediawiki.org/wiki/Extension:ConfirmEdit Extension:ConfirmEdit] installed
** and setup with FancyCaptcha
* The VisualEditor, Cite, and Echo extensions should be installed to run the full suite of tests
* Create an account Selenium_newuser which has an edit count of 0
* Create an account and store the username in MEDIAWIKI_USER which has
** an edit count of greater than 0
** Ensure user has bureaucrat and admin rights (set via Special:UserRights)

==== Selenium tests ====

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
  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 steps that create pages (create_page_api_steps.rb) 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 Minerva directory with:

  bundle exec cucumber tests/browser/features

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/watchstar.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