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

Added Code - To show Screenshots even at AfterHooks Step #59

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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 @@ -10,7 +10,7 @@ case class Match(location: String = "", arguments: Option[List[Argument]])

case class BeforeHook(result: Result, output: List[String], `match`: Match)

case class AfterHook(result: Result, output: List[String], `match`: Match)
case class AfterHook(result: Result, output: List[String], `match`: Match,embeddings: List[Embedding])

case class Row(cells: List[String])

Expand Down Expand Up @@ -58,4 +58,4 @@ case class Feature(keyword: String,
val scenariosExcludeBackground = {
elements.filterNot(e => e.keyword == "Background")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ object CucumberTransformer extends Log {
}

private[cucumber] def donutScenarioScreenshots(e: Element) = {
val elementScreenshots: List[Embedding] = e.steps.flatMap(s => s.embeddings)
val elementScreenshots: List[Embedding] = e.after.flatMap(s => if (s.embeddings != Nil) s.embeddings else e.steps.flatMap(t => t.embeddings))
val screenshotsSize = elementScreenshots.size
val screenshotStyle = if (elementScreenshots.nonEmpty) "" else "display:none;"
val screenshots = elementScreenshots.map(e => DonutEmbedding(e.mime_type, e.data, e.id))
Expand Down