(Draft)
It is already known that our development will be strongly test driven. That's the only way to guarantee high quality, easy development and simple maintenance.
Testing Environment
A dedicated test space is available at our SVN: http://svn.fckeditor.net/tests/
It is structured with the following directories:
/ (root)
In the root directory, we'll find the index.html file, which should introduce the testing environment.
/runners
All test frameworks are to be installed here. For JavaScript we'll have the following frameworks:
- /runners/jsunit - JSUnit
- /runners/selenium - Selenium
All references to runners must be done using its absolute URL (e.g. /runners/jsunit)
/<project name>
Each project has its own directory in the root, containing all its tests. For V3, this directory is "/v3".
This directory may also contain include files (for configuration, for example) to be injected inside the test pages, making it possible to setup the testing environment with easy.
/<project name>/dt
Design tests. Here we find all tests produced during the code development.
/<project name>/tt
Ticket tests. Here we find tests used during the ticket handling. It is usually used to confirm bugs, avoiding regressions.
/<project name>/(dt|tt)/(unit|visual|interactive|<others>)
Both the "dt" and "tt" folders will contain specific directories to separate tests by test framework:
- unit: JSUnit based tests (for JavaScript code).
- selenium: Selenium based tests (for JavaScript code).
- interactive: user interactive tests.
- <others>: any other name that could be useful for the project. For example, PHP code tests could be found inside the "php" folder.
/<project name>/(dt|tt)/(unit|visual|interactive|<others>)/(<code unit>|<ticket number>)
The final piece of the folders tree to reach the test pages is a folder identifying the test group. In the case of Design Tests (dt) this folder is to be named as the code unit that identify the tests, like a class or object name. For Ticket Tests (tt) instead, it is the ticket number.
Inside this folder, all tests will be created by using sequential numbers. So, we may find files names: 1.html, 2.html, etc.
If a test requires additional files, those files must be included in a folder named just like the test, so 1.html would have a folder named "1".
Accessing the Tests
By checking out the SVN repository for the tests, we recommending setting up a local web site for it, responding to the "t" domain name. In this way, to access a test for ticket 123, for example, we could use URLs like the following:
http://t/v3/tt/unit/123/1.html
We'll be using URLs like the above inside ticket comments, forums, IRC, etc. In an updated and well configured environment, those URLs should open the specific test to be run.