|
@ -102,7 +102,8 @@ class Report(): |
|
|
elif len(testcase) > 1: |
|
|
elif len(testcase) > 1: |
|
|
html = "<title>"+REP_TITLE+" "+REP_TC+" "+testcase+"</title></head><body><h1>"+REP_TITLE+" "+REP_TC+" "+testcase+"</h1>" |
|
|
html = "<title>"+REP_TITLE+" "+REP_TC+" "+testcase+"</title></head><body><h1>"+REP_TITLE+" "+REP_TC+" "+testcase+"</h1>" |
|
|
else: |
|
|
else: |
|
|
html = "<title>"+REP_TITLE+" "+REP_TS+" "+getattr(job.par, "testsuite")+"</title></head><body><h1>"+REP_TITLE+" "+REP_TS+" "+getattr(job.par, "testsuite")+"</h1>" |
|
|
html = "<title>"+REP_TITLE+" "+REP_TS+" "+getattr(job.par, "usecase")+"</title>" |
|
|
|
|
|
html += "</head><body><h1>"+REP_TITLE+" "+REP_TS+" "+getattr(job.par, "usecase")+"</h1>" |
|
|
if hasattr(job.par, B.PAR_DESCRIPT): |
|
|
if hasattr(job.par, B.PAR_DESCRIPT): |
|
|
html += "<p>"+getattr(job.par, B.PAR_DESCRIPT)+"</p>" |
|
|
html += "<p>"+getattr(job.par, B.PAR_DESCRIPT)+"</p>" |
|
|
return html |
|
|
return html |
|
@ -117,12 +118,18 @@ class Report(): |
|
|
:return: |
|
|
:return: |
|
|
""" |
|
|
""" |
|
|
cssClass = "result0" |
|
|
cssClass = "result0" |
|
|
if len(match) > 0: |
|
|
if len(match) > 0 and len(artefact) > 0: |
|
|
if match in self.report[testcase][component][artefact]: |
|
|
if match in self.report[testcase][component][artefact]: |
|
|
if "css" in self.report[testcase][component][artefact][match]: |
|
|
if "css" in self.report[testcase][component][artefact][match]: |
|
|
if cssClass < self.report[testcase][component][artefact][match]["css"]: |
|
|
if cssClass < self.report[testcase][component][artefact][match]["css"]: |
|
|
cssClass = self.report[testcase][component][artefact][match]["css"] |
|
|
cssClass = self.report[testcase][component][artefact][match]["css"] |
|
|
return cssClass |
|
|
return cssClass |
|
|
|
|
|
elif len(match) > 0: |
|
|
|
|
|
for a in self.report[testcase][component]: |
|
|
|
|
|
val = self.getCssClass(testcase, component, a, match) |
|
|
|
|
|
if cssClass < val: |
|
|
|
|
|
cssClass = val |
|
|
|
|
|
return cssClass |
|
|
elif len(artefact) > 0: |
|
|
elif len(artefact) > 0: |
|
|
for match in self.report[testcase][component][artefact]: |
|
|
for match in self.report[testcase][component][artefact]: |
|
|
if "css" in self.report[testcase][component][artefact][match]: |
|
|
if "css" in self.report[testcase][component][artefact][match]: |
|
@ -197,16 +204,16 @@ class Report(): |
|
|
for side in ["A", "B"]: |
|
|
for side in ["A", "B"]: |
|
|
path = self.report[testcase][component][artefact][matchtype]["path"+side] |
|
|
path = self.report[testcase][component][artefact][matchtype]["path"+side] |
|
|
href = path.replace(job.conf.confs[B.SUBJECT_PATH][B.ATTR_PATH_ARCHIV], os.path.join("..", "..")) |
|
|
href = path.replace(job.conf.confs[B.SUBJECT_PATH][B.ATTR_PATH_ARCHIV], os.path.join("..", "..")) |
|
|
html += M.MATCH[M.MATCH[M.MATCH_POSTCOND][side]]["long"]+" " |
|
|
html += M.MATCH[M.MATCH[matchtype][side]]["long"]+" " |
|
|
html += "<a href=\""+href+"\">"+path+"<a>\n" |
|
|
html += "<a href=\""+href+"\">"+path+"<a>\n" |
|
|
if side == "A": html += "<br>" |
|
|
if side == "A": html += "<br>" |
|
|
html += "</p>" |
|
|
html += "</p>" |
|
|
return html |
|
|
return html |
|
|
|
|
|
|
|
|
def getFilepath(self, testcase, component, artefact, matchtype): |
|
|
def getFilepath(self, testcase, component, artefact, matchtype): |
|
|
cm = basic.componentHandling.ComponentManager() |
|
|
cm = basic.componentHandling.ComponentManager.getInstance("init") |
|
|
comp = cm.getComponent(component) |
|
|
comp = cm.getComponent(component) |
|
|
path = os.path.join(utils.path_tool.composePatttern("{tcresult}", comp), artefact+"_"+M.MATCH[matchtype]["filename"]+".html") |
|
|
path = os.path.join(utils.path_tool.composePattern("{tcresult}", comp), artefact+"_"+M.MATCH[matchtype]["filename"]+".html") |
|
|
return path |
|
|
return path |
|
|
|
|
|
|
|
|
def getComparisonBlock(self, testcase, component, artefact, matchtype): |
|
|
def getComparisonBlock(self, testcase, component, artefact, matchtype): |
|
@ -233,6 +240,8 @@ class Report(): |
|
|
def extractTestcase(self, testcase, html): |
|
|
def extractTestcase(self, testcase, html): |
|
|
job = basic.program.Job.getInstance() |
|
|
job = basic.program.Job.getInstance() |
|
|
verify = int(job.getDebugLevel("report_tool")) - 1 |
|
|
verify = int(job.getDebugLevel("report_tool")) - 1 |
|
|
|
|
|
if not testcase in self.report: |
|
|
|
|
|
self.report = {} |
|
|
overview = re.findall("<tr class.+tc-overview.*</tr>", html) |
|
|
overview = re.findall("<tr class.+tc-overview.*</tr>", html) |
|
|
if len(overview) == 1: |
|
|
if len(overview) == 1: |
|
|
self.report[testcase]["overview"] = overview[0] |
|
|
self.report[testcase]["overview"] = overview[0] |
|
@ -245,16 +254,16 @@ class Report(): |
|
|
def reportTestsuite(self): |
|
|
def reportTestsuite(self): |
|
|
job = basic.program.Job.getInstance() |
|
|
job = basic.program.Job.getInstance() |
|
|
verify = int(job.getDebugLevel("report_tool")) - 1 |
|
|
verify = int(job.getDebugLevel("report_tool")) - 1 |
|
|
testcases = getattr(job.par, "testcases") |
|
|
testinstances = getattr(job.par, "testinstances") |
|
|
html = self.getHeader() |
|
|
html = self.getHeader() |
|
|
html += self.getTitle() |
|
|
html += self.getTitle() |
|
|
i = 0 |
|
|
i = 0 |
|
|
for testcase in testcases: |
|
|
for testcase in testinstances: |
|
|
if i == 0: html += self.getOverviewHead(testcase) |
|
|
if i == 0: html += self.getOverviewHead(testcase) |
|
|
html += self.report[testcase]["overview"] |
|
|
html += self.report[testcase]["overview"] |
|
|
i += 1 |
|
|
i += 1 |
|
|
html += "</table>" |
|
|
html += "</table>" |
|
|
for testcase in testcases: |
|
|
for testcase in testinstances: |
|
|
html += self.report[testcase]["block"] |
|
|
html += self.report[testcase]["block"] |
|
|
html += "</body></html>" |
|
|
html += "</body></html>" |
|
|
return html |
|
|
return html |
|
|