Changes between Version 14 and Version 15 of TestManagerForTracPluginRPCApi


Ignore:
Timestamp:
Dec 14, 2014, 10:37:49 AM (9 years ago)
Author:
Roberto Longobardi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestManagerForTracPluginRPCApi

    v14 v15  
    4646        For documentation about each test object's properties,
    4747        refer to the [wiki:TestManagerForTracPluginPythonApi Python API].
     48        [wiki:TestManagerForTracPlugin#Customfields Custom fields] ARE supported.
    4849        Returns True if successful, False otherwise.
    4950       
     
    119120# trac_project_url = "http://anonymous@localhost:8000/my_test_project/rpc"
    120121#
    121 trac_project_url = "http://user@yourserver:port/yourproject/rpc"
    122 
    123 print ">> Connecting to '%s'" % trac_project_url
     122# trac_project_url = "http://user@yourserver:port/yourproject/rpc"
     123trac_project_url = "http://anonymous@localhost:8000/test01/rpc"
     124
     125print ""
     126print "-------- Connecting to '%s'" % trac_project_url
     127print ""
     128
    124129server = xmlrpclib.ServerProxy(trac_project_url)
    125130
     
    130135
    131136print ">> Creating sub-catalog"
    132 sub_cat = server.testmanager.createTestCatalog(root_cat, "Test Sub-Catalog RPC", "This is a wonderful sub-catalog.")
     137sub_cat = server.testmanager.createTestCatalog(root_cat, "Test Sub-Catalog RPC", "This is a wonderful sub-catalog.", {'remarks': 'These are the Remarks'})
    133138print sub_cat
    134139
    135140print ">> Creating two test cases in the root catalog"
    136 tc_1 = server.testmanager.createTestCase(root_cat, "Test Case 1", "This is a wonderful test case.")
     141tc_1 = server.testmanager.createTestCase(root_cat, "Test Case 1", "This is a wonderful test case.", {'component': 'Framework'})
    137142print tc_1
    138 tc_2 = server.testmanager.createTestCase(root_cat, "Test Case 2", "This is an even more wonderful test case.")
     143tc_2 = server.testmanager.createTestCase(root_cat, "Test Case 2", "This is an even more wonderful test case.", {'testeffort': '1000'})
    139144print tc_2
    140145
     
    145150print tc_4
    146151
     152print ">> Listing root-level catalogs"
     153for tc in server.testmanager.listRootCatalogs():
     154    for v in tc:
     155        print v
     156
    147157print ">> Listing sub-catalogs of root test catalog"
    148158for tc in server.testmanager.listSubCatalogs(root_cat):
     
    156166
    157167print ">> Creating a test plan on the root catalog"
    158 tplan = server.testmanager.createTestPlan(root_cat, "Test Root Plan RPC")
     168tplan = server.testmanager.createTestPlan(root_cat, "Test Root Plan RPC", {'longdescription': 'This is a veeeeeery long description.'})
    159169print tplan
    160170
    161171print ">> Listing test plans available on specified test catalog"
    162 for tp in server.testmanager.listTestPlans('0'):
     172for tp in server.testmanager.listTestPlans(root_cat):
    163173    for v in tp:
    164174        print v
     
    186196print ">> Getting test plan on root catalog properties"
    187197for v in server.testmanager.getTestPlan(tplan, root_cat):
     198    print v
     199
     200print ">> Verifying root test catalog properties has been changed"
     201for v in server.testmanager.getTestCatalog(root_cat):
    188202    print v
    189203
     
    248262printPlan(root_cat, tplan)
    249263
    250 print ">> Setting test case status"
     264print ">> Setting test case status (note: this actually creates the TestCaseInPlan object into the DB)"
    251265print server.testmanager.setTestCaseStatus(tc_2, tplan, 'successful')
    252266
     
    258272print server.testmanager.setTestCaseStatus(tc_2, tplan, 'failed')
    259273
    260 print ">> Verifying the test case status has been changed"
     274print ">> Modifying test case in plan custom field"
     275print server.testmanager.modifyTestObject('testcaseinplan', tc_2, {'planid': tplan, 'operating_system': "Macosx"})
     276
     277print ">> Verifying the test case status and custom field have been changed"
    261278for v in server.testmanager.getTestCase(tc_2, tplan):
    262279    print v
     
    264281print ">> Printing again complete test plan tree, showing modified test case status"
    265282printPlan(root_cat, tplan)
    266 
    267283}}}