QA/Testing/Test Case

Introduction
Test case is a series of simple steps that has to be done to check a particular functionality. It is an atomic part of regression tests.

Good Test
In theory, we could test any functionality as we like. In practice, we have limited number of people and time for doing the tests. We need some optimization:


 * create tests only for important or often broken stuff
 * do not test the same things in many test cases
 * prefer automatic over manual testing

People like finishing tasks. We have many volunteers that have only limited time for doing some work. The test cases need to have reasonable scope:


 * split complex features into more simple test cases
 * though, do not split it too much; preparation steps might cause a lot of duplicated work
 * any test case should be doable in less than on hour

Any user should be able to run the test case:


 * use easy and well defined instructions, e.g. select in menu File/Open; enter "testfile" in the input field "file name"; press the button [OK]
 * use easy and well defined expected results, e.g, the paragraph should be intended by 2 pixels; the file save dialog should pop out; the background of cell A1 should turn to be red
 * describe how to setup the machine for more complex testing, .e.g. Samba server, dual monitor, address book for the mail merge test
 * mention where to get useful test files or more details

Define Test Case
Test cases are organized in a management tool that is called MozTrap. If you want to add a new test cases, please follow the instructions:

Check existing test cases

 * Check existing test cases to avoid duplication.
 * open http://manual-test.libreoffice.org/ in a browser.
 * switch to the tab Manage/Cases
 * you could do a quick search via the 'Enter filter tems' box right above the page
 * to do more complicated search, click the << Advanced Filtering button, where the frequently used fields could be:
 * Product Version: usually it should be Libreoffice 0 which is designed as the base for other versions, Libreoffice 0 is also the default criteria if you do not check any box in this field
 * Name: define a criteria which will have all test case name searched
 * INSTRUCTION: define a criteria which will have all test case instructions body searched
 * EXPECTED RESULT: define a criteria which will have all test case restuls body searched
 * Notice
 * to use input boxes searching criteria(like Name, INSTRUCTION and EXPECTED RESULT), type any filtering words in them and press Enter on the keyboard. There should be a new checkbox generated right below the input box, get them checked and the search will start immediately.

Add a new test case
You will need special permission to write test cases into MozTrap. If you do not have it, please follow the next steps but provide the information as described at the test case contribution page.


 * Login MozTrap with your authorized account and switch to tab Manage/Cases
 * Click the button:
 * + Create a test case
 * Populate appropriate fields:
 * Product - LibreOffice
 * Version - usually it should be 0, this is the base of most other versions.
 * And Later Versions - Check on the box then the test case you are creating will be added to other version automatically.
 * Suite - choose the right one by priority.
 * if you are unsure whether the functionality priority and properties, ask on the [mailto:libreoffice@lists.freedesktop.org developer mailing list]
 * Name - describe test case name, the name of a test case should be short but explicitly summarize the testing coverage
 * Tags - the available tags are p1, p2, p3, p4 and general, base, calc, draw, impress, math, writer, which stands there as their name implies.
 * we should provide tags for each test case, which will highly promote the test cases in a manageable manner. For example p1, general or p2, calc etc.
 * only a test manager is allowed to create new tags as required
 * Description - describe background of the test case, preparation steps if any
 * Add attachment - you can attach sample test documents
 * Add concrete test instructions and expected results:
 * describe what is the action should a tester take in the instructions field
 * describe what is the expected result in the important steps
 * Important: do not take apart test instructions into multiple MozTrap native INSTRUCTION/EXPECTED fields, instead put them in one row and use simple markdown symbols to give a elegant format. The reason is we want to support translation version of test cases, the MozTrap native INSTRUCTION/EXPECTED fields are currently used to divide different language version of a test case. Click here to see a real-life edit sample, click here to see how it would look like to testers.
 * Besides, we have an fine example as follows.

If a more detailed guide is required for how these can be operated in MozTrap, please refer to the MozTrap user guide.

Example test case
In English
 * Product: Libreoffice
 * Version: 0
 * And Later Versions: ON
 * Suite: Priority 2
 * Tags: p2, impress
 * Attachment: test document
 * Name: 3D Slide Transistions
 * 1. Instruction (the 1st row of instruction/expected fields in MozTrap)

=
* Flipping Tiles * Outside turning cube * Revolving circles * Turning helix * Inside turning cube * Fall * Turn around * Iris * Turn Down * Rochade * Venetian Blinds 3D Vertical * Venetian Blinds 3DHorizontal * Fine Dissolve * Newsflash In English
 * download the attached test file and open it in LibreOffice
 * run the slide show: menu "Slide Show/Slide Show" [F5]
 * go through all slides by [Enter] until the end of the presentation (*vp.1*)
 * select the tab "Slide Transition" in the "Task" panel"
 * Try to set different 3D transition for different pages (*vp.2*):
 * 1. Expected (the 1st row of instruction/expected fields in MozTrap)

=
1. Each slide should appear with another 3D transition 2. The corresponding 3d transition effect should be played as a preview once

In French
 * 2. Instruction (the 2nd row of instruction expected fields in MozTrap)

=
* [Put the French translation here] * [Put the French translation here] ... In French
 * [Put the French translation here]
 * [Put the French translation here]
 * 2. Expected (the 2nd row of instruction expected fields in MozTrap)

=
1. [Put the French translation here] ...

As what's done above...put other translation version afterwards...
 * 3. Instruction (the 3rd row of instruction expected fields in MozTrap)