Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Selenium tests

From MoodleDocs

Creating Selenium tests for common Moodle tasks.

Introduction

Selenium is an automated testing framework designed to test Web Graphical User Interfaces (see http://openqa.org/selenium-ide). Test scripts are built using a record-playback method, and can then be played back by various selenium clients and programming languages (depending on the export format).

In Moodle there are many common tasks which are performed the same way no matter what specific use the host makes of Moodle. The goal of these GHOP tasks is to create a number of automated Selenium tests which will be used during development to ensure that new bug fixes do not introduce new User Interface bugs.

Guidelines

To perform these tasks, you need:

  1. A new install of Moodle (the version will be indicated in the task title)
  2. The Selenium IDE firefox plugin (see links below)

The most important thing to remember is that the test must run successfully on any platform where a new install of Moodle is running. This explains why we need to create and run the tests on a new install.

Cleanup

In your test script, if you create Database content through your actions (such as creating a new course), make sure you delete it at the end, as part of your script. This will help make the test more portable, so that it leaves nothing behind (no need to manually delete test data or re-install Moodle).

Links

QA and testing-related content from the moodle site