From 4a5af14dd7a8e5a45c6b0cd37a817422ea2ee7f4 Mon Sep 17 00:00:00 2001 From: renatoathaydes Date: Mon, 26 Mar 2018 19:31:25 +0200 Subject: [PATCH] #132 added back link (for index page) to Spec reports. --- .../report/internal/HtmlReportCreator.groovy | 7 +++---- src/main/resources/spock-feature-report.css | 4 ++++ .../spockframework/report/internal/FakeTestReport.html | 3 +++ .../report/internal/SpecIncludingExtraInfoReport.html | 3 +++ .../spockframework/report/internal/UnrolledSpecReport.html | 3 +++ .../report/internal/VividFakeTestReport.html | 3 +++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/com/athaydes/spockframework/report/internal/HtmlReportCreator.groovy b/src/main/groovy/com/athaydes/spockframework/report/internal/HtmlReportCreator.groovy index c22de0a2..acb4b918 100644 --- a/src/main/groovy/com/athaydes/spockframework/report/internal/HtmlReportCreator.groovy +++ b/src/main/groovy/com/athaydes/spockframework/report/internal/HtmlReportCreator.groovy @@ -13,13 +13,9 @@ import org.spockframework.runtime.model.IterationInfo import org.spockframework.runtime.model.SpecElementInfo import org.spockframework.runtime.model.Tag import spock.lang.Ignore -import spock.lang.Issue import spock.lang.PendingFeature -import spock.lang.See import spock.lang.Title -import java.lang.annotation.Annotation - /** * * User: Renato @@ -136,6 +132,9 @@ class HtmlReportCreator extends AbstractHtmlCreator @Override void writeSummary( MarkupBuilder builder, SpecData data ) { + builder.div( 'class': 'back-link' ) { + a( href: 'index.html', '<< Back' ) + } builder.div( 'class': 'summary-report' ) { h3 'Summary:' builder.div( 'class': 'date-test-ran', whenAndWho.whenAndWhoRanTest( stringFormatter ) ) diff --git a/src/main/resources/spock-feature-report.css b/src/main/resources/spock-feature-report.css index 51c4159e..4c3ab398 100644 --- a/src/main/resources/spock-feature-report.css +++ b/src/main/resources/spock-feature-report.css @@ -11,6 +11,10 @@ h3 { font-weight: 200; } +.back-link { + font-size: small; +} + table { margin: 5px; } diff --git a/src/test/resources/com/athaydes/spockframework/report/internal/FakeTestReport.html b/src/test/resources/com/athaydes/spockframework/report/internal/FakeTestReport.html index 22de7742..b0c6b4fa 100644 --- a/src/test/resources/com/athaydes/spockframework/report/internal/FakeTestReport.html +++ b/src/test/resources/com/athaydes/spockframework/report/internal/FakeTestReport.html @@ -9,6 +9,9 @@

Report for ${classOnTest}


+

Summary:

Created on ${dateTestRan} by ${username}
diff --git a/src/test/resources/com/athaydes/spockframework/report/internal/SpecIncludingExtraInfoReport.html b/src/test/resources/com/athaydes/spockframework/report/internal/SpecIncludingExtraInfoReport.html index d230073c..1f677be6 100644 --- a/src/test/resources/com/athaydes/spockframework/report/internal/SpecIncludingExtraInfoReport.html +++ b/src/test/resources/com/athaydes/spockframework/report/internal/SpecIncludingExtraInfoReport.html @@ -9,6 +9,9 @@

Report for ${classOnTest}


+

Summary:

Created on ${dateTestRan} by ${username}
diff --git a/src/test/resources/com/athaydes/spockframework/report/internal/UnrolledSpecReport.html b/src/test/resources/com/athaydes/spockframework/report/internal/UnrolledSpecReport.html index 523c4faa..4eed3f1e 100644 --- a/src/test/resources/com/athaydes/spockframework/report/internal/UnrolledSpecReport.html +++ b/src/test/resources/com/athaydes/spockframework/report/internal/UnrolledSpecReport.html @@ -6,6 +6,9 @@

Report for com.athaydes.spockframework.report.UnrolledSpec


+

Summary:

Created on ${dateTestRan} by ${username}
diff --git a/src/test/resources/com/athaydes/spockframework/report/internal/VividFakeTestReport.html b/src/test/resources/com/athaydes/spockframework/report/internal/VividFakeTestReport.html index 01d6b497..717e37f4 100644 --- a/src/test/resources/com/athaydes/spockframework/report/internal/VividFakeTestReport.html +++ b/src/test/resources/com/athaydes/spockframework/report/internal/VividFakeTestReport.html @@ -9,6 +9,9 @@

Report for ${classOnTest}


+

Summary:

Created on ${dateTestRan} by ${username}