krogold
5 years agoRegular Contributor
Is it possible to check if a 'run test case' step is properly linked to a testcase ?
Hello,
after doing a merge, I realized I made som 'savage' cuts in my testcases, removing cases that, I though, were no longer used. In fact some of them were still used and I have to steps that are not unlinked.
I'd like to parse all my steps and check which ones are faulty but I can't do it by hands. Is there any step property that indicates if a teststep is linked or not ?
thanks
Alex
well, in fact I found that I can use the "targetTestCase" property ...
sorry for disturbing
if someone needs it :
testRunner.testCase.testSuite.project.testSuiteList.each{ TS -> ts_name = TS.name if (ts_name != "tools") { // for each test case TS.getTestCaseList().each{ TC -> tc_name = TC.name if (tc_name.contains("TODO") == false) { // parse test cases TC.getTestStepList().each{ tStep-> if (tStep.name.contains("- todo")) { log.warn "obsolete step to discard: " + tStep.name } else if (tStep.config.type == "calltestcase") { if (tStep.targetTestCase == null) { log.info "$tc_name / ${tStep.name} link is broken" } } } } } } }