Auto-generated Test Specification Documents

Test Specification Documents (smith docs) can be automatically generated from special comments embedded in a .smith file. This option is available from the Tools/Generate Smith Doc menu option; it applies only to the currently open script. The generated file will be saved in the same directory, and with the same base name as the script it is generated from. It will have a .smithdoc extension. If the script has _call statements to open subscripts you will be prompted to include/exclude the subscripts. Once the file is generated you can choose to view it in the default text editor immediately by selecting "Yes" from the prompt that appears.



Syntax

Character/s Meaning
#$Indicates a doc comment. A doc comment can be on its own line or embedded at the end of a script line. It cannot be embedded inside a regular comment.
.[...]Each dot resolves to a tab in the smith doc
A or aResolves to the text "[A/action]" in the smith doc.
The full word 'action' or an abbreviation thereof, e.g. 'act' can be used in place of 'a'.
R or rResolves to the text "[R/result]" in the smith doc.
The full word 'result' or an abbreviation thereof, e.g. 'res' can be used in place of 'r'.
V or vResolves to the text "[V/verify]" in the smith doc.
The full word 'verify' or an abbreviation thereof, e.g. 'ver' can be used in place of 'v'.


Example

The smithdoc-example.smith script will generate the following .smithdoc file:


TestSmith


Test Specification for:


D:\QualityForge\TestSmith\Scripts\smithdoc-example.smith


-------------------------------------------------------------





Start Test





	Start Transaction 1


	--------------------------------------------


		[Action] Click the red button


		[Result] The red star should appear on the page


		[Verify] The red star image is present


		[verify] The save button is enabled


		[action] Click the Save button


		[result] Land on 'Done' page


		[verify] The phrase 'red star' is on the 'Done' page


	--------------------------------------------


	End Transaction 1





	[action] Navigate back to home page


	[verify] Main text header





	Start Transaction 2


	--------------------------------------------


		[action] Click the blue button


		[result] The blue circle should appear on the page


		[verify] The blue circle image is present


		[verify] The save button is enabled


		[Action] Click the Save button


		[Result] Land on 'Done' page


		[Verify] phrase 'blue circle' is on the 'Done' page


	--------------------------------------------


	End Transaction 2





End Test





-------------------------------------------------------------


auto-generated: 2004/08/10 15:30:00




The two sample scripts, datadriven.smith and yahoo-login.smith both contain doc comments. Smith Docs can be generated from these scripts as further examples of the use of doc comments.