lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

Unable to create new build with optional arguments #129

Closed hayatmor closed 4 years ago

hayatmor commented 4 years ago

I was trying to create new build with the following parameters and was succeeded to create it only with 3 parameters (721816, "4.00.122,buildnotes)

tlss = TestlinkAPIGeneric(TESTLINK_API_PYTHON_SERVER_URL,TESTLINK_API_PYTHON_DEVKEY) newBuild = tlss.createBuild(721816, "4.00.122.123", buildnotes='Notes for Build',active=0,open=0,releasedate='2020-11-30')

{'name': '4.00.122.1212253', 'notes': 'Notes for Build', 'testplan_id': '721816', 'closed_on_date': '', 'release_date': '', 'is_open': '1', 'active': '1', 'creation_ts': '2020-03-05 07:04:34', 'id': '118997'}

lczub commented 4 years ago

Hello haytmor,

the trick is, you have to use the child class TestlinkAPIClient instead TestlinkAPIGeneric.

These are the createBuild arguments of the generic api class. It uses the same mandatory and optional parameter as the TL api server it defines

from testlink import TestlinkAPIGeneric
myTestLinkGen = TestlinkAPIGeneric(TEST_URL_1919_DOCKER, TEST_DEVKEY_DOCKER, verbose=False)
print(myTestLinkGen.whatArgs('createBuild'))

createBuild(<testplanid>, <buildname>, [buildnotes=<buildnotes>], [active=<active>], [open=<open>], [releasedate=<releasedate>], [copytestersfrombuild=<copytestersfrombuild>], [devKey=<devKey>])
 Creates a new build for a specific test plan 

        active      : 1 (default) = activ  0 = inactiv 
        open        : 1 (default) = open   0 = closed
        releasedate : YYYY-MM-DD
        copytestersfrombuild : valid buildid tester assignments will be copied.

And these are the arguments of the child api class, which tries to define some more comfortable parameter combinations.

from testlink import TestlinkAPIClient
myTestLink = TestlinkAPIClient(TEST_URL_1919_DOCKER, TEST_DEVKEY_DOCKER, verbose=False)
print(myTestLink.whatArgs('createBuild'))

createBuild(<testplanid>, <buildname>, <buildnotes>, [active=<active>], [open=<open>], [releasedate=<releasedate>], [copytestersfrombuild=<copytestersfrombuild>], [devKey=<devKey>])
 Creates a new build for a specific test plan 

        active      : 1 (default) = activ  0 = inactiv 
        open        : 1 (default) = open   0 = closed
        releasedate : YYYY-MM-DD
        copytestersfrombuild : valid buildid tester assignments will be copied.

Hope this helps, Luiko

hayatmor commented 4 years ago

Hi @lczub , Thank you for the quick replay!

i fix my code and send this command: newBuild = myTestLinkGen.createBuild(testplanid=721816,buildname="4.00.122.1234",buildnotes='Notes for Build', active='0',open='0',releasedate='2020-01-30') this is the result from the TestLink Website(Version TestLink 1.9.13 (Stormbringer)) : image As you can see its only update the build name and the notes , the action/open/realese date wasn't change this is the full code: myTestLinkGen = TestlinkAPIGeneric(TESTLINK_API_PYTHON_SERVER_URL, TESTLINK_API_PYTHON_DEVKEY,verbose=False) 'print(myTestLinkGen.whatArgs('createBuild'))' newBuild = myTestLinkGen.createBuild(testplanid=721816,buildname="4.00.122.1234",buildnotes='Notes for Build', active='0',open='0',releasedate='2020-01-30') C:\git\python\Scripts\python.exe C:/git/TestLink-API-Python-client-0.8.1/createTestlinkBuild.py createBuild(, , [buildnotes=], [active=], [open=], [releasedate=], [copytestersfrombuild=], [devKey=]) Creates a new build for a specific test plan

    active      : 1 (default) = activ  0 = inactiv 
    open        : 1 (default) = open   0 = closed
    releasedate : YYYY-MM-DD
    copytestersfrombuild : valid buildid tester assignments will be copied.

Process finished with exit code 0

--**** i try also with the TestlinkAPIClient and recvied this myTestLinkGen = TestlinkAPIClient("https://mcpitf.dal.design.ti.com/testlink/lib/api/xmlrpc/v1/xmlrpc.php", "88015afebd363bd4e2f787ea2663b9d6",verbose=False)

image

lczub commented 4 years ago

Hello hayatmor,

as you can see in CHANGES - TestLink-API-Python-client release notes v0.6.3, the optional parameter active , open and releasedate are supported by the Server not before TestLink v1.19.15.

If you want to use these parameter, you have to update your server first.

Regards Luiko

hayatmor commented 4 years ago

Hi @lczub ,

Thank you very much for your kind answers. this solve my issue