Selenium/Getting Started/Create a simple test

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

MediaWiki Core
Let's write a new simple test for MediaWiki core. For example,  is one of the rare pages that does not have   link. Let's write a test to check that.

Code
Following code is in Gerrit (345378).

A new test file should be created:

A new page object file should be created:

Output
To run all tests, run this from MediaWiki core folder:

To run just the new test file, run this from MediaWiki core folder, in two separate terminal tabs or windows:

MediaWiki Extension
Let's write a new simple test for a MediaWiki extension. For example, RelatedArticles. I am not familiar with the extension, so the test is creating a page and checking it's contents. I just wanted to show how to write a test for an extension. Another example is a test for VisualEditor (345146).

Code
Following code is in Gerrit (337602).

A new test file should be created:

Output
To run all tests, run this from MediaWiki core folder:

To run just the new test file, run this from MediaWiki core folder, in two separate terminal tabs or windows: