Skip to content

Is there any efficient way to get execution type of testcase? #103

@chintanvadgama

Description

@chintanvadgama

I would like to get all automated/manual cases for the test project. Currently, I am doing this in a very inefficient way.

EXECUTION_TYPES = {'manual': '1', 'automated': '2'}
project='test-project'
def getTestCasesByExecutionType(execType=''):
    testcases = []
    projID = tlapi.getTestProjectByName(project)['id']
    parent_ts = tlapi.getFirstLevelTestSuitesForTestProject(projID)[0]
    tcInfo = tlapi.getTestCasesForTestSuite(testsuiteid=parent_ts['id'],deep=True,details='full') #Have to call with details "full" as execution_type is only included in "full" details of testcase
    for each_tcInfo in tcInfo:
        if each_tcInfo['execution_type'] == EXECUTION_TYPES[execType.lower()]:
            testcases.append(each_tcInfo)
    return testcases

The above is not efficient solution as it has to get "full" details of each test case just to get the execution_type which takes a lot of time when number of testcases are in thousands. I would be grateful if you could point out any efficient method or other solution to determine execution_type.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions