Web CGI tools

After the command-line tools are tested, the CGI gateway and email gateway may be tested in parallel. The following tests exercise the functionality of the CGI gateway in a very high-level manner; since most of the tests involve passing input and output to the command-line tools, the test descriptions here are lightweight to avoid any repetition of the previous tests (which would involve keeping the test suites synchronized, etc.) Before executing the CGI tests, you must install the CGI gateway on a host machine using an existing repository, as with the command-line tools (ie installed with test_data/good_template as the only issue template, and test_data/sample_defect_1 and test_data/sample_defect_2 as the only filed defects. This can be done using the command-line tools prior to installing the repository.

Test case # CGI.CHANGE-HTML-TEMPLATES.TC

Test items

This tests requirements CGI.CHANGE-HTML-TEMPLATES.FR1 through FR4

Required pretests

Command-line tests and their pretests

Test script

Table 2-12. Test script: CGI.CHANGE-HTML-TEMPLATES.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the cgi-templates/gateway.html template, modified to include the host repository's list of issue templates. Ensure that the file is displayed correctly. Ensure that the list of issue templates is correctly populated (should show the test repository's only template, defect.

Test case # CGI.LIST.TC

Test items

This tests requirements CGI.LIST.FR1 through FR4

Required pretests

Command-line tests and their pretests, and CGI.CHANGE-HTML-TEMPLATES

Test script

Table 2-13. Test script: CGI.LIST.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the appropriate gateway template.
Select the "defect" template and the "list issues" option and submitSystem should respond with the cat_menu.html template, modified to show the issue type "defect" and both filed issues.
Select the first issue and submitSystem should respond with the cat_action.html template modified to show the listing of the first defect, converted to an HTML table. Verify that attributes are in a subtable. Verify that children use a different headline than parents (check page source if necessary)
Return to the menu by using the "back" button on your browser. Select the second defect and resubmitVerify that the second defect is displayed correctly
Return to the menu. Type the identifier of the first defect in the text box. Do not select any items in the list. Submit.Verify that the first defect is displayed correctly
Return to the menu. Type garbage in the text box and select an issue. Submit.System should display the selected issue and display another entry stating that the garbage in the text box could not be found

Test case # CGI.FREEQUERY.TC

Test items

This tests requirements CGI.FREEQUERY.FR1 through CGI.FREEQUERY.FR6

Required pretests

Command-line tests and their pretests, and CGI.CHANGE-HTML-TEMPLATES

Test script

Table 2-14. Test script: CGI.FREEQUERY.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the appropriate gateway template.
Select the "defect" template and the "free query" option and submitSystem should respond with the free_query_menu.html template, requesting a query string from the user.
Type a query string from the QUERY.TC test case and submitSystem should respond with the free_query_result.html template modified to show the query string from the user and a properly-formatted list of nodes matching that query string (verify this against the command-line query command's output).
Return to the menu. Sequentially repeat all tests from the QUERY.TC test case.Verify that output matches output from the QUERY.TC test case.

Test case # CGI.QUERY.TC

Test items

This tests requirements CGI.QUERY.FR1 through CGI.FREEQUERY.FR4

Required pretests

Command-line tests and their pretests, and CGI.FREEQUERY.TC

Test script

Table 2-15. Test script: CGI.QUERY.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the appropriate gateway template.
Select the "defect" template and the "query by example" option and submitSystem should respond with the query_form.html template modified to include a form listing the root element's attributes (selection list box for each enumerated attribute, text input line for each text attribute) and the root level children.
User should fill in sample values for each top level attribute and at least one of the children and submitSystem should respond with the free_query_result template modified to include the results of this query. Verify that the "query string" listed on the return page matches the entries made in the form on the previous page.

Test case # CGI.SUBMIT.TC

Test items

This tests requirements CGI.SUBMIT.FR1 through CGI.SUBMIT.FR8

Required pretests

Command-line tests and their pretests, and CGI.CHANGE-HTML-TEMPLATES.TC

Test script

Table 2-16. Test script: CGI.SUBMIT.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the appropriate gateway template.
Select the "defect" template and the "submit a new issue" option and submitSystem should respond with the submit_form.html template modified to include a form. For each enumerated attribute in each element, the form should include a drop-down list box with the possible choices listed. For each text attribute, the form should include a text line fillin. For the contents of each editable text element, the form should include a text area for larger text input.
User should fill in values for each attribute and element as appropriate, and submit the form.System should file the report and respond with the submission_result.html template modified to include the text feedback of the file command. The new issue should be filed correctly.

Test case # CGI.EDIT.TC

Test items

This tests requirements CGI.EDIT.FR1 through CGI.EDIT.FR5

Required pretests

Command-line tests and their pretests, and CGI.CHANGE-HTML-TEMPLATES.TC

Test script

Table 2-17. Test script: CGI.EDIT.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the appropriate gateway template.
Select the "defect" template and the "edit an existing issue" option and submitSystem should respond with the edit_menu.html template modified to list the available issues for that template. Multiple selections should not be allowed.
Type an invalid id in the fillin box.System should respond that the requested id is invalid and will not be edited.
Return to the previous page (issue selection). Type the id of a valid issue and submitSystem should load the requested issue from disk and create an HTML form based off the issue. All elements and attributes should be listed, with existing values for that issue inserted as default responses for each item. Verify (via an additional window and the LIST command, the cat command-line command, or inspection of the actual issue file) that the values present in the form do reflect the existing values for the issue.
Edit a few values and resubmitSystem should respond with feedback similar to that of the SUBMIT command. Verify that the new version of the issue was submitted correctly.
Verify that editing and submission works when an issue is selected from the list rather than typed in the edit box (ie repeat previous steps using a different selection method) 

Test case # CGI.REGISTER-TEMPLATE.TC

Test items

This tests requirements CGI.REGISTER-TEMPLATE.FR1 through CGI.REGISTER-TEMPLATE.FR3

Required pretests

Command-line tests and their pretests, and CGI.CHANGE-HTML-TEMPLATES.TC

Test script

Table 2-18. Test script: CGI.REGISTER-TEMPLATE.TC

User actionsSystem Response/User examination
Open the cgi script gateway-cgi.py.System should respond with the appropriate gateway template.
Select the "defect" template and the "register a new template" option and submitSystem should respond with the register_template.html template, showing a large text box with a default entry.
Run through the REGISTER-TEMPLATE.TC test cases using the CGI tool.System should respond with the same basic output as that in REGISTER-TEMPLATE.TC.