From dec17cbd29820f99035474f3fe3e6bd78d3949c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4fer?= Date: Sun, 21 Sep 2014 17:00:16 +0200 Subject: [PATCH] show number of cases in the scenario headline of the HTML report (#26) --- .../tngtech/jgiven/report/html/ScenarioHtmlWriter.java | 5 +++++ .../com/tngtech/jgiven/report/html/default.css | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/jgiven-core/src/main/java/com/tngtech/jgiven/report/html/ScenarioHtmlWriter.java b/jgiven-core/src/main/java/com/tngtech/jgiven/report/html/ScenarioHtmlWriter.java index cef9c75d62..1e93ad6f3e 100644 --- a/jgiven-core/src/main/java/com/tngtech/jgiven/report/html/ScenarioHtmlWriter.java +++ b/jgiven-core/src/main/java/com/tngtech/jgiven/report/html/ScenarioHtmlWriter.java @@ -43,7 +43,12 @@ public void visit( ScenarioModel scenarioModel ) { writer.print( " " + WordUtil.capitalize( scenarioModel.description ) ); + int numberOfCases = scenarioModel.getScenarioCases().size(); + if( numberOfCases > 1 ) { + writer.print( "" + numberOfCases + "" ); + } utils.writeDuration( scenarioModel.getDurationInNanos() ); + writer.println( "" ); writeTagLine( scenarioModel ); diff --git a/jgiven-core/src/main/resources/com/tngtech/jgiven/report/html/default.css b/jgiven-core/src/main/resources/com/tngtech/jgiven/report/html/default.css index de58a49b4e..28d4713675 100644 --- a/jgiven-core/src/main/resources/com/tngtech/jgiven/report/html/default.css +++ b/jgiven-core/src/main/resources/com/tngtech/jgiven/report/html/default.css @@ -427,6 +427,16 @@ h1 { vertical-align: middle; } +.count { + background-color: #aaa; + color: white; + border-radius: 7px; + font-size: 10px; + margin-right: 0em; + margin-left: 0.5em; + background-color: gray; +} + .stages { margin: 0; margin-top: 10px;