Skip to content

Commit

Permalink
html report merger skip not existing report (#85)
Browse files Browse the repository at this point in the history
* Issue #31
- Fixing headerline from NOT OK to Standard FAILED after merge
- continue if report html file did not exist
- print task warning message
  • Loading branch information
vansari authored Sep 6, 2021
1 parent b5ae132 commit 659a9f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Merger/HtmlReportMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ public function run()
throw XPathExpressionException::malformedXPath($xpathExprRefNodes);
}
for ($k = 1, $kMax = count($this->src); $k < $kMax; $k++) {
$srcHTML = new DOMDocument();
$src = $this->src[$k];
if (!file_exists($src) || !is_readable($src)) {
$this->printTaskWarning('File did not exists or is not readable: ' . $src);
continue;
}
$srcHTML = new DOMDocument();
$srcHTML->loadHTMLFile($src, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$this->countExecutionTime($srcHTML);
$xpathExprSuiteNodes = "//div[@class='layout']/table/tr";
Expand Down Expand Up @@ -199,7 +203,7 @@ private function updateHeaderLine(DOMDocument $dstFile): void
$statusNode = $nodeList[0]->childNodes[1]->childNodes[0];
$statusAttr = $statusNode->attributes[0];
if (0 !== ($this->countFailed + $this->countIncomplete + $this->countSkipped)) {
$statusNode->nodeValue = 'NOT OK';
$statusNode->nodeValue = 'FAILED';
$statusAttr->value = 'color: red';
}
$executionTimeNode->nodeValue = " ({$this->executionTimeSum}s)";
Expand Down

0 comments on commit 659a9f9

Please sign in to comment.