Beispiel #1
0
# TESTLINK_API_PYTHON_SERVER_URL=http://YOURSERVER/testlink/lib/api/xmlrpc.php
# TESTLINK_API_PYTHON_DEVKEY=7ec252ab966ce88fd92c25d08635672b
#
# alternative precondition b)
# SERVEUR_URL and KEY are defined as command line arguments
# python TestLinkExample.py --server_url http://YOURSERVER/testlink/lib/api/xmlrpc.php
#                           --devKey 7ec252ab966ce88fd92c25d08635672b
#
# ATTENTION: With TestLink 1.9.7, cause of the new REST API, the SERVER_URL
#            has changed from
#               (old) http://YOURSERVER/testlink/lib/api/xmlrpc.php
#            to
#               (new) http://YOURSERVER/testlink/lib/api/xmlrpc/v1/xmlrpc.php
tl_helper = TestLinkHelper(server_url="http://192.168.1.67/testlink/lib/api/xmlrpc/v1/xmlrpc.php", devkey="9fcab75a07b343c40fbe91c98a1bb326")
tl_helper.setParamsFromArgs('''Shows how to use the TestLinkAPI.
=> Counts and lists the Projects 
=> Create a new Project with the following structure:''')
myTestLink = tl_helper.connect(TestlinkAPIClient)

myPyVersion = python_version()   # 本地python版本
myPyVersionShort = myPyVersion.replace('.', '')[:2]

NEWTESTPLAN_A = "TestPlan_API A"
NEWTESTPLAN_B = "TestPlan_API B"
NEWTESTPLAN_C = "TestPlan_API C - DeleteTest"
NEWPLATFORM_A = 'Big Birds %s' % myPyVersionShort
NEWPLATFORM_B = 'Small Birds'
NEWPLATFORM_C = 'Ugly Birds'
NEWTESTSUITE_A = "A - First Level"
NEWTESTSUITE_B = "B - First Level"
NEWTESTSUITE_AA = "AA - Second Level"