FusionForge

Difference between revisions of "Test Suite"

From FusionForge Wiki
Jump to: navigation, search
m (Functional test suite)
m (Functional test suite)
 
(One intermediate revision by the same user not shown)
Line 23: Line 23:
 
== Functional test suite ==
 
== Functional test suite ==
  
The principle is to run a series of tests against the Web interface of the forge, in a controlled Firefox Web browser, using the [http://www.seleniumhq.org Selenium] tool. The tests are written in a PHPUnit Test Suite, which includes invocation of Selenium test primitives to check contents of the Web pages.
+
The principle is to run a series of tests against the Web interface of the forge, in a controlled Firefox Web browser, using the [http://www.seleniumhq.org Selenium] tool. The tests are written in a PHPUnit Test Suite (using [https://github.com/sebastianbergmann/phpunit-selenium phpunit-selenium]), which includes invocation of Selenium test primitives to check contents of the Web pages.
  
 
=== Running the whole test suite ===
 
=== Running the whole test suite ===

Latest revision as of 14:51, 4 May 2014

The fusionforge code base includes two test suites, which can perform :

  • a number of unit tests (including some syntactical ones) that are applied to the code.
  • other higher-level functionnal tests, which are conducted with Selenium.

Unit tests

TBD

$ make build-unit-tests

Applying unit tests :

$ cd tests/ 
$ phpunit AllTests.php

Requirements

  • phpunit
  • htmlpurifier

Individual test sources are in :

  • /tests/code/syntax/

Functional test suite

The principle is to run a series of tests against the Web interface of the forge, in a controlled Firefox Web browser, using the Selenium tool. The tests are written in a PHPUnit Test Suite (using phpunit-selenium), which includes invocation of Selenium test primitives to check contents of the Web pages.

Running the whole test suite

The easiest way is to use the Virtual machine development environment which provides all necessary dependencies, including the correct initialization of the database so that it can be reinitialized between test cases.

The environment installed in that VM is similar to the one used by the project build bots, which help testing the tests before deploying to the whole project.

Selenium in Fusionforge tests

Run a single selenium test example :

sh -x tests/scripts/phpunit.sh RPMCentos52Tests.php [--wait] --filter="ContextualHelp::testContextualHelp"

Selenium IDE

You can download the mozilla plugin available at [1]

See also