FusionForge

Difference between revisions of "Test Suite"

From FusionForge Wiki
Jump to: navigation, search
(syntax)
Line 1: Line 1:
There are a number of unit tests (including some syntactical ones) that are applied to the code.
+
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.
  
Other higher-level tests are conducted with Selenium.
+
== Unit tests ==
  
 
TBD
 
TBD
Line 12: Line 14:
 
  $ phpunit AllTests.php
 
  $ phpunit AllTests.php
  
== Requirements ==
+
=== Requirements ===
 
* phpunit
 
* phpunit
 
* htmlpurifier
 
* htmlpurifier
Line 19: Line 21:
 
* /tests/code/syntax/
 
* /tests/code/syntax/
  
== Selenium IDE ==
+
== Functional test suite ==
  
You can download the mozilla plugin available at [http://seleniumhq.org/projects/ide/ ]
+
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, 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.
  
== Selenium in Fusionforge tests ==
+
=== Selenium in Fusionforge tests ===
  
 
Run a single selenium test example :
 
Run a single selenium test example :
 
  sh -x tests/scripts/phpunit.sh RPMCentos52Tests.php --wait --filter="ContextualHelp::testContextualHelp"
 
  sh -x tests/scripts/phpunit.sh RPMCentos52Tests.php --wait --filter="ContextualHelp::testContextualHelp"
 +
 +
=== Selenium IDE ===
 +
 +
You can download the mozilla plugin available at [http://seleniumhq.org/projects/ide/ ]
 +
  
 
== See also ==
 
== See also ==

Revision as of 14:06, 30 April 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, 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.

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