Selenium/Ruby/Shared features

This is a list of features provided by the RubyGemthat are available to all browser tests in all repos. See Quality Assurance/Browser testing/Writing tests for an introduction to writing tests.

Login
Logs the user in on the wiki specified by the environment variable MEDIAWIKI_URL

Usage
In any Scenario in any Feature, just use

and the shared login step will use the environment variables MEDIAWIKI_USER and MEDIAWIKI_PASSWORD to login at the target wiki.

Random page
Sends the script to a random page in the target wiki

Usage
In any Scenario in any Feature, just use

Reset preferences
Resets all of the test user's preferences to default settings.

Usage
In any Scenario in any Feature, just use

ResourceLoader errors
After loading any page, this step will check for ResourceLoader errors and report any modules that have errors and any modules that are missing.

Usage
In any Scenario in any Feature, just use

Upload file
Steps to upload valid or invalid media files via the shared interface in both Firefox and Chrome

Usage
In any Scenario in any Feature, just use

to upload a valid PNG image file

and

to upload an invalid empty file

Create page at run time via API
Creates a page with particular title and text in the target wiki at runtime.

Usage
In the steps for any Scenario do

Note the creative possibilities:


 * to create a page in the target wiki with a quasi-unique title that the running Scenario will be able to find and use in the course of the test:


 * to guarantee that a particular page in the target wiki will have particular content, and then navigate to that page: