Sunday, November 10, 2013

0 Template for supporting Quality Assurance Automation

Like I mentioned before, testlogger main objective is to support automation side of Quality Assurance. For this we have given 6 functions namely,

  1. test_script
  2. test_case
  3. test_step
  4. close_test_script
  5. close_test_case
  6. close_test_step
Before going into explanation on how to use these functions, please read through below guidelines/template to follow while developing your test scripts. If this template is ignored, generating result files is not assured.

For those who are working on testing domain would agree on fact that, 
"A test plan is a collection of test cases. A test case is again a collection of test steps."
We developed testlogger to strictly follow these rules of a test plan hierarchy that goes like below.

Rules that we can derive from above structure:
  • A test script is the super node of all nodes. It could comprise of multiple test cases, test steps, warnings, messages and errors.
  • A test case must be the child node of a test script and it cannot stand by itself. It could comprise of  multiple test steps, warnings, messages. 
  • A test step must be the child node of a test case and it cannot stand by itself. It could comprise of multiple warnings, messages and errors.
  • Note: messages, warnings and errors can be displayed at any level of the hierarchy. They can even exist with out the presence of any of the above nodes. We designed testlogger this way because we want this tool to be used even for general logging.
  • Every test script, test case and test step should be properly closed using respective close functions to indicate scope of these nodes.
Code Template

require 'testlogger'

  #messages warnings and errors can be placed at any line of the code
  #test script starts here
  Log.test_script("samplecode.rb")

  #####################################################################

    #test case starts under a test_script
    #we can have multiple test cases as part of a test script
    #We should begin another test case only after this test case is properly closed.
    Log.test_case(100,"TestCase1")
 
    ###################################################################
 
      #test step starts under a test_case
      #we can have multiple test steps as part of a test case
      #We should begin another test step only after this test step is properly closed.
      Log.test_step(1234,"TestStep1")
   
        Log.message("howdy!!")
        Log.warning("follow the template")
        Log.error("otherwise this could lead to unexpected results")
     
      #close test step
      Log.close_test_step
   
      #we can open another test step here, if we would like to.
   
    ###################################################################    
 
    #close the test case
    Log.close_test_case
 
    #we can open another test case here, if we would like to.
 
  #####################################################################

  #close the test script
  Log.close_test_step


I will leave output for the readers to explore. Let us discuss more about functions used above in coming tutorials.

Happy Testing,
Shiva Krishna Imminni


0 comments:

Post a Comment

 

QuestionSelenium Copyright @Shiva Krishna