#!/usr/bin/python # program to compare the results of a testcase # PARAM: --environment --application --tcdir [ testcase, tctime ] # main functions # + compare_testcase() : archiv.result --> data --> archiv.matchresult # --------------------------------------------------- import sys# import os import basic.program as program import utils.tdata_tool import utils.report_tool import utils.path_tool import utils.file_tool import basic.componentHandling import basic.message as message # Press Umschalt+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. PROGRAM_NAME = "compare_testcase" def startPyJob(job): cm = basic.componentHandling.ComponentManager.getInstance(job) print("cm "+str(cm)) cm.initComponents() comps = cm.getComponents(PROGRAM_NAME) job.m.setMsg("# Components initialized with these relevant components " + str(comps)) report = utils.report_tool.Report(job) testdata = utils.tdata_tool.getTestdata(job) for c in comps: comp = cm.getComponent(c) comp.m.logInfo("------- "+comp.name+" ----------------------------------------") comp.compare_results(job, report) comp.m.logInfo("------- "+comp.name+" ----------------------------------------") job.m.merge(comp.m) print(str(comp)) comp.conf["function"][PROGRAM_NAME] = comp.m.topmessage text = report.reportTestcase(job.par.testcase) path = os.path.join(job.par.tcdir, "Result.html") utils.file_tool.writeFileText(job.m, job, path, text) # Press the green button in the gutter to run the script. if __name__ == '__main__': print(PROGRAM_NAME) x = program.Job(PROGRAM_NAME) x.startJob() x.m.logInfo("hier eine LogInfo") x.m.logDebug("hier eine DbugMeldung") x.m.logDebug(str(vars(x.par)) + "\n" + str(vars(x.conf))) if x.m.isRc("fatal"): x.stopJob() exit(x.m.rc * (-1) + 3) startPyJob(x) x.stopJob() # See PyCharm help at https://www.jetbrains.com/help/pycharm/