Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screenshot name to test report #294

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ class ExecutionReporter {
val testName = screenshot.testName
val originalScreenshot = "./images/recorded/" + screenshot.name + ".png"
val width = (screenshot.screenshotDimension.width * 0.2).toInt
val screenshotName = screenshot.name
"<tr>" +
s"<th> <p>Test class: $testClass</p>" +
s"<p>Test name: $testName</p></th>" +
s"<p>Screenshot name: $screenshotName</p></th>" +
s"<th> <a href='$originalScreenshot'><img width='$width' src='$originalScreenshot'/></a></th>" +
"</tr>"
}
Expand Down Expand Up @@ -128,12 +130,14 @@ class ExecutionReporter {
val reason = generateReasonMessage(error)
val color = if (isFailedTest) "red-text" else "green-text"
val id = screenshot.name.replace(".", "")
val screenshotName = screenshot.name

if (showOnlyFailingTestsInReports && isFailedTest || !showOnlyFailingTestsInReports) {
"<tr>" +
s"<th><a href='#$id'>$result</a></th>" +
s"<th><a href='#$id'><p class='$color'>Test class: $testClass</p>" +
s"<p class='$color'>Test name: $testName</p></a></th>" +
s"<p class='$color'>Screenshot name: $screenshotName</p></th>" +
s"<th>$reason</th>" +
"</tr>"
} else {
Expand Down Expand Up @@ -162,11 +166,13 @@ class ExecutionReporter {
val color = if (isFailedTest) "red-text" else "green-text"
val width = (screenshot.screenshotDimension.width * 0.2).toInt
val id = screenshot.name.replace(".", "")
val screenshotName = screenshot.name

if (showOnlyFailingTestsInReports && isFailedTest || !showOnlyFailingTestsInReports) {
"<tr>" +
s"<th id='$id'> <p class='$color'>Test class: $testClass</p>" +
s"<p class='$color'>Test name: $testName</p></th>" +
s"<p class='$color'>Screenshot name: $screenshotName</p></th>" +
s"<th> <a href='$originalScreenshot'><img width='$width' src='$originalScreenshot'/></a></th>" +
s"<th> <a href='$newScreenshot'><img width='$width' src='$newScreenshot'/></a></th>" +
s"<th> <a href='$diff'><img width='$width' src='$diff'/></a></th>" +
Expand Down