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
m (formatting)
m (Adding a section with links to testing practices and technologies from the moodle site.)
 
Line 1: Line 1:
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).


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:
# A new install of Moodle (the version will be indicated in the task title)
# A new install of Moodle (the version will be indicated in the task title)
# The Selenium IDE firefox plugin (see links below)
#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.
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/
 
*Firefox Selenium extension: http://release.openqa.org/selenium-ide/0.8.7/selenium-ide-0.8.7.xpi
* Selenium site: http://openqa.org/selenium-ide/
*Video tutorial: http://wiki.openqa.org/download/attachments/400/Selenium+IDE.swf?version=1
* Firefox Selenium extension: http://release.openqa.org/selenium-ide/0.8.7/selenium-ide-0.8.7.xpi
*Example Selenium script: http://google-highly-open-participation-moodle.googlecode.com/files/course_creation_selenium.html (PS: this must be run from the page reached by an admin who just logged in)
* Video tutorial: http://wiki.openqa.org/download/attachments/400/Selenium+IDE.swf?version=1
==QA and testing-related content from the moodle site==
* Example Selenium script: http://google-highly-open-participation-moodle.googlecode.com/files/course_creation_selenium.html (PS: this must be run from the page reached by an admin who just logged in)
*[[Testing strategy/Testing Methodology At Moodle|Testing strategy/Testing Methodology At Moodle - MoodleDocs]]
*[[QA testing|QA testing - MoodleDocs]]
*[[Testing strategy/The Moodle Testing Process|Testing strategy/The Moodle Testing Process - MoodleDocs]]

Latest revision as of 11:49, 19 April 2022

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