Selenium/How-to/Create the first test in a repository

This tutorial will assume that you are running tests from your machine, targeting MediaWiki-Docker.

For more examples see Selenium/Getting Started/Create a simple test page and Selenium/Reference/Example Code.

Let's write a new simple test for Extension:Examples. For example, let's check if the extension is listed at  page.

Following code is available at 674939.

Simple
The minimal amount of code is just one spec file and just one page object file.

Typical
Typical patch will have a few more files. You will need these files if this is the first Selenium test in the repository.

tests/selenium/log


 * 1) Selenium tests

For more information see https://www.mediawiki.org/wiki/Selenium


 * 1) Setup

See https://www.mediawiki.org/wiki/MediaWiki-Docker/Extension/Examples


 * 1) Run all specs

npm run selenium-test


 * 1) Run specific tests

Filter by file name:

npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME]

Filter by file name and test name:

npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME] --mochaOpts.grep [TEST-NAME]