Data-Test-Executer Framework speziell zum Test von Datenverarbeitungen mit Datengenerierung, Systemvorbereitungen, Einspielungen, ganzheitlicher diversifizierender Vergleich
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

62 lines
2.3 KiB

#!/usr/bin/python
# program to execute steps of a testcase
# PARAM: --environment --application --tcdir [ testcase, tctime ]
# main functions
# + craete_request() : testspec --> tdata.step --> archiv.request
# + send_request() : archiv.request -- comp-config --> system.interface
# ---------------------------------------------------
import traceback
import basic.program as program
import utils.tdata_tool
import utils.report_tool
import utils.path_tool
import utils.file_tool
import basic.componentHandling
# 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 = "execute_testcase"
def startPyJob(job):
try:
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))
tdata = utils.tdata_tool.getTestdata(job)
print(str(tdata))
if not "_steps" in tdata:
raise Exception("no steps to execute in testdata")
for (step) in tdata["_steps"]:
if step.comp in comps:
comp = cm.getComponent(step.comp)
comp.execute_test(job, step, tdata)
job.m.merge(comp.m)
else:
job.m.setError(step.comp+" kann nicht aufgerufen werden!")
except Exception as e:
job.m.logDebug("+++++++++++++++++++++++++++++++++++++++++++++")
job.m.setFatal(str(e))
job.m.logDebug("+++++++++++++++++++++++++++++++++++++++++++++")
job.m.logDebug("execpt "+traceback.format_exc())
job.m.logDebug("+++++++++++++++++++++++++++++++++++++++++++++")
# 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/