Note:

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

Selenium tests: Difference between revisions

From MoodleDocs
(First draft)
 
m (formatting)
Line 1: Line 1:
#summary Creating Selenium tests for common Moodle tasks.
Creating Selenium tests for common Moodle tasks.


= Introduction =
== 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).
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).
Line 7: Line 7:
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.
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 =
== Guidelines ==


To perform these tasks, you need:
To perform these tasks, you need:
Line 16: Line 16:
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.
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 =
== 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).
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 =
== Links ==


* Selenium site: http://openqa.org/selenium-ide/
* Selenium site: http://openqa.org/selenium-ide/

Revision as of 14:05, 21 February 2008

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