+ <#if allRequested>
+ ${counter}
+ #if>
+
+
+ ${report.name?html}
+
+
+
+ ${element.name?html}
+
+ <#if element.isMultiRunParent()>
+ Previous
+ Runs
+
#if>
-
-
- ${report.name?html}
-
-
-
- ${element.name?html}
- <#if element.firstExceptionClass != "">
- ${element.firstExceptionClass}
- #if>
- <#if isGroupPreviousScenarioRuns() && isLastOfMultipleScenarioRuns && !allRequested>
- <#list element.getChildrenElements() as childElement>
-
- #list>
- #if>
-
-
- ${element.startDateString} ${element.startTimeString}
-
-
- ${element.returnTotalDurationString()}
-
- <#if allRequested>
- <@common.status status=element.status.statusString/>
+
+ <#if element.firstExceptionClass != "">
+ ${element.firstExceptionClass}
+ #if>
+
+ <#if element.isMultiRunParent()>
+
#if>
-
- #if>
+
+
diff --git a/engine/src/main/resources/template/rerun-scenarios.ftl b/engine/src/main/resources/template/rerun-scenarios.ftl
new file mode 100644
index 00000000..cbb03a19
--- /dev/null
+++ b/engine/src/main/resources/template/rerun-scenarios.ftl
@@ -0,0 +1,18 @@
+<#--
+Copyright 2024 trivago N.V.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<#assign reruns = 1 />
+<#include "scenario-summary.ftl">
\ No newline at end of file
diff --git a/engine/src/main/resources/template/scenario-detail.ftl b/engine/src/main/resources/template/scenario-detail.ftl
index 39a01e0c..d1861e45 100644
--- a/engine/src/main/resources/template/scenario-detail.ftl
+++ b/engine/src/main/resources/template/scenario-detail.ftl
@@ -71,20 +71,25 @@ preheadlineLink="pages/feature-scenarios/feature_${element.featureIndex?c}.html"
#if>
Total ${element.returnTotalDurationString()}
- <#if groupPreviousScenarioRuns && element.getIsLastOfMultipleScenarioRuns()>
+ <#assign numberOfChildren = element.getMultiRunChildren()?size>
+ <#if groupPreviousScenarioRuns && element.multiRunParent>
- This is the last run of this scenario.
+ This is the final scenario run after ${numberOfChildren}
+ previous ${common.pluralizeFn("run", numberOfChildren)}.
#if>
- <#if groupPreviousScenarioRuns && element.getIsNotLastOfMultipleScenarioRuns()>
+ <#if groupPreviousScenarioRuns && element.multiRunChild>
- There are later runs of this scenario.
+ There are more runs of this scenario.
#if>
- <#if (element.hasHooks() && element.hasHooksWithContent()) || element.hasSubSections() || (element.hasStepHooks() && element.hasStepHooksWithContent()) || element.hasDocStrings()>
+ <#if (element.hasHooks() && element.hasHooksWithContent()) ||
+ element.hasSubSections() ||
+ (element.hasStepHooks() && element.hasStepHooksWithContent()) ||
+ element.hasDocStrings()>
#if>
diff --git a/engine/src/main/resources/template/scenario-summary.ftl b/engine/src/main/resources/template/scenario-summary.ftl
index c03a264e..59cf4456 100644
--- a/engine/src/main/resources/template/scenario-summary.ftl
+++ b/engine/src/main/resources/template/scenario-summary.ftl
@@ -56,6 +56,15 @@ limitations under the License.
<#assign subsubheadline = "">
<#assign preheadline = "">
<#assign preheadlineLink = "">
+<#elseif (reruns??)>
+ <#assign base = "./..">
+ <#assign headline = "Rerun Scenarios">
+ <#assign pageName = "Rerun Scenarios">
+ <#assign highlight = "rerun_scenarios">
+ <#assign subheadline = "">
+ <#assign subsubheadline = "">
+ <#assign preheadline = "">
+ <#assign preheadlineLink = "">
<#else>
<#assign base = "./..">
<#assign headline = "All Scenarios">
@@ -112,11 +121,12 @@ preheadlineLink=preheadlineLink>
#if>
- <#if isGroupPreviousScenarioRuns() && hasNotLastRunScenarios() && !(scenarioSequence??)>
+
+ <#if hasMultiRunChildren()>
-
Toggle ${totalNumberOfNotLastScenariosRuns} Previous Test Runs
+ Toggle ${totalNumberOfMultiRunChildren} Previous Runs
#if>
@page.card>
@@ -144,4 +154,27 @@ preheadlineLink=preheadlineLink>
<@scenario.table status="skipped" numberOfScenarios=totalNumberOfSkippedScenarios />
<@scenario.table status="passed" numberOfScenarios=totalNumberOfPassedScenarios />
#if>
+
+
@page.page>
diff --git a/engine/src/main/resources/template/snippets/js.ftl b/engine/src/main/resources/template/snippets/js.ftl
index 38554dfe..7b7c0d98 100644
--- a/engine/src/main/resources/template/snippets/js.ftl
+++ b/engine/src/main/resources/template/snippets/js.ftl
@@ -123,13 +123,13 @@ limitations under the License.
$(".scenarioDocstring").collapse("show");
}
if (${expandPreviousScenarioRuns?c}) {
- $(".btn-outline-secondary[data-cluecumber-item='show-not-last-runs-button']").click();
+ $("[data-cluecumber-item='multi-run-button']").click();
}
}
);
function resizeIframe(iframe) {
- setInterval(function() {
+ setInterval(function () {
try {
iframe.height = iframe.contentWindow.document.body.scrollHeight + 25 + "px";
} catch (e) {
diff --git a/engine/src/main/resources/template/tree-view.ftl b/engine/src/main/resources/template/tree-view.ftl
index 4360bf75..0e78e4b8 100644
--- a/engine/src/main/resources/template/tree-view.ftl
+++ b/engine/src/main/resources/template/tree-view.ftl
@@ -44,7 +44,7 @@ preheadlineLink="">
<#list scenarios as scenario>
- <#if ((!scenario.getIsLastOfMultipleScenarioRuns() && !scenario.getIsNotLastOfMultipleScenarioRuns()) || scenario.getIsLastOfMultipleScenarioRuns()) >
+ <#if ((!scenario.isMultiRunParent() && !scenario.isMultiRunChild()) || scenario.isMultiRunParent()) >
${scenario.name?html}
diff --git a/engine/src/test/java/com/trivago/cluecumber/engine/json/pojo/DocStringTest.java b/engine/src/test/java/com/trivago/cluecumber/engine/json/pojo/DocStringTest.java
index 1b5074ec..0e6b452e 100644
--- a/engine/src/test/java/com/trivago/cluecumber/engine/json/pojo/DocStringTest.java
+++ b/engine/src/test/java/com/trivago/cluecumber/engine/json/pojo/DocStringTest.java
@@ -25,10 +25,16 @@ public void returnWithClickableLinksTest() {
assertEquals(docString.returnWithClickableLinks(), "This should be a https://www.google.de link");
}
+ @Test
+ public void returnWithClickableLinksFalseAlarmTest() {
+ docString.setValue("This should be a profile link with some profile stuff.");
+ assertEquals(docString.returnWithClickableLinks(), "This should be a profile link with some profile stuff.");
+ }
+
@Test
public void returnWithClickableLocalLinksTest() {
- docString.setValue("The shared location is file:\\MACHINE\\Folder\\Some Folder");
- assertEquals(docString.returnWithClickableLinks(), "The shared location is file:\\MACHINE\\Folder\\Some Folder ");
+ docString.setValue("The shared location is file:\\MACHINE\\Folder\\Some Folder ");
+ assertEquals(docString.returnWithClickableLinks(), "The shared location is <a href='file:\\MACHINE\\Folder\\Some Folder' target='_blank'>file:\\MACHINE\\Folder\\Some Folder</a>");
}
@Test
diff --git a/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java b/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java
index dcd3f465..5d261d86 100644
--- a/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java
+++ b/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java
@@ -26,6 +26,7 @@ public void addMultipleRunsInformationToScenariosTest() {
Report report = new Report();
List elements = new ArrayList<>();
+ // First run of scenario 1
Element element = new Element();
element.setName("Scenario 1");
element.setType("scenario");
@@ -34,6 +35,7 @@ public void addMultipleRunsInformationToScenariosTest() {
element.setStartTimestamp("2019-04-11T08:00:21.123Z");
elements.add(element);
+ // Scenario 2 without reruns
element = new Element();
element.setName("Scenario 2");
element.setType("scenario");
@@ -42,6 +44,7 @@ public void addMultipleRunsInformationToScenariosTest() {
element.setStartTimestamp("2019-04-11T08:00:21.123Z");
elements.add(element);
+ // Last run of scenario 1
element = new Element();
element.setName("Scenario 1");
element.setType("scenario");
@@ -56,15 +59,16 @@ public void addMultipleRunsInformationToScenariosTest() {
List e = reports.get(0).getElements();
elementMultipleRunsPreProcessor.addMultipleRunsInformationToScenarios(reports);
+ assertEquals(2, e.size());
- assertTrue(e.get(0).getIsNotLastOfMultipleScenarioRuns());
- assertFalse(e.get(1).getIsNotLastOfMultipleScenarioRuns());
- assertFalse(e.get(2).getIsNotLastOfMultipleScenarioRuns());
- assertFalse(e.get(0).getIsLastOfMultipleScenarioRuns());
- assertFalse(e.get(1).getIsLastOfMultipleScenarioRuns());
- assertTrue(e.get(2).getIsLastOfMultipleScenarioRuns());
- assertEquals(e.get(0).getChildrenElements().size(), 0);
- assertEquals(e.get(1).getChildrenElements().size(), 0);
- assertEquals(e.get(2).getChildrenElements().size(), 1);
+ assertFalse(e.get(0).isPartOfMultiRun());
+ assertFalse(e.get(0).isMultiRunParent());
+ assertFalse(e.get(0).isMultiRunChild());
+ assertEquals(e.get(0).getMultiRunChildren().size(), 0);
+
+ assertTrue(e.get(1).isPartOfMultiRun());
+ assertTrue(e.get(1).isMultiRunParent());
+ assertFalse(e.get(1).isMultiRunChild());
+ assertEquals(e.get(1).getMultiRunChildren().size(), 1);
}
}
diff --git a/engine/src/test/java/com/trivago/cluecumber/engine/rendering/pages/pojos/pagecollections/AllScenariosPageCollectionTest.java b/engine/src/test/java/com/trivago/cluecumber/engine/rendering/pages/pojos/pagecollections/AllScenariosPageCollectionTest.java
index afaa6f32..3bbc674e 100644
--- a/engine/src/test/java/com/trivago/cluecumber/engine/rendering/pages/pojos/pagecollections/AllScenariosPageCollectionTest.java
+++ b/engine/src/test/java/com/trivago/cluecumber/engine/rendering/pages/pojos/pagecollections/AllScenariosPageCollectionTest.java
@@ -4,6 +4,7 @@
import com.trivago.cluecumber.engine.json.pojo.Report;
import com.trivago.cluecumber.engine.json.pojo.Result;
import com.trivago.cluecumber.engine.json.pojo.Step;
+import com.trivago.cluecumber.engine.json.processors.ElementMultipleRunsPreProcessor;
import com.trivago.cluecumber.engine.rendering.pages.pojos.CustomParameter;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -168,18 +169,34 @@ public void hasSkippedScenariosTest() {
}
@Test
- public void hasNotLastRunScenariosTest() {
- assertFalse(allScenariosPageCollection.hasNotLastRunScenarios());
- Report[] reportList = new Report[1];
+ public void hasMultiRunChildrenTest() {
+ List reports = new ArrayList<>();
Report report = new Report();
List elements = new ArrayList<>();
+
Element element = new Element();
- element.setIsNotLastOfMultipleScenarioRuns(true);
+ element.setName("Scenario 1");
+ element.setType("scenario");
+ element.setId("feature1-scenario1");
+ element.setLine(3);
+ element.setStartTimestamp("2019-04-11T08:00:21.123Z");
+ elements.add(element);
+
+ element = new Element();
+ element.setName("Scenario 1");
+ element.setType("scenario");
+ element.setId("feature1-scenario1");
+ element.setLine(3);
+ element.setStartTimestamp("2019-04-11T08:00:25.829Z");
elements.add(element);
+
report.setElements(elements);
- reportList[0] = report;
- allScenariosPageCollection.addReports(reportList);
- assertTrue(allScenariosPageCollection.hasNotLastRunScenarios());
+ reports.add(report);
+
+ new ElementMultipleRunsPreProcessor().addMultipleRunsInformationToScenarios(reports);
+ assertFalse(allScenariosPageCollection.hasMultiRunChildren());
+ allScenariosPageCollection.addReports(reports.toArray(new Report[0]));
+ assertTrue(allScenariosPageCollection.hasMultiRunChildren());
}
@Test
diff --git a/examples/core-example/pom.xml b/examples/core-example/pom.xml
index 5209a35b..b3b00696 100644
--- a/examples/core-example/pom.xml
+++ b/examples/core-example/pom.xml
@@ -6,8 +6,8 @@
blog.softwaretester
core-example
- 3.4.0
- pom
+ 3.8.0
+ jar
11
diff --git a/examples/maven-example/json/rerun/rerun.json b/examples/maven-example/json/rerun/rerun.json
new file mode 100755
index 00000000..af573897
--- /dev/null
+++ b/examples/maven-example/json/rerun/rerun.json
@@ -0,0 +1,154 @@
+[
+ {
+ "description": "This is a rerun feature",
+ "elements": [
+ {
+ "start_timestamp": "2024-09-03T09:23:51.166Z",
+ "description": "",
+ "id": ";",
+ "keyword": "Scenario",
+ "line": 2,
+ "name": "This is an interesting scenario",
+ "steps": [
+ {
+ "keyword": "Given ",
+ "line": 3,
+ "match": {
+ "location": "SomeClass.java:-2"
+ },
+ "name": "this is the first step",
+ "result": {
+ "duration": 18244280571,
+ "status": "passed"
+ }
+ },
+ {
+ "keyword": "And ",
+ "line": 4,
+ "match": {
+ "location": "SomeClass.java:-2"
+ },
+ "name": "this is the second step",
+ "result": {
+ "duration": 6155261782,
+ "error_message": "This is the error message of step 2",
+ "status": "failed"
+ }
+ }
+ ],
+ "tags": [
+ {
+ "name": "@rerun"
+ }
+ ],
+ "type": "scenario"
+ }
+ ],
+ "id": "",
+ "keyword": "Feature",
+ "line": 1,
+ "name": "Rerun",
+ "uri": "features/rerun/rerun.feature"
+ },
+ {
+ "description": "This is a rerun feature",
+ "elements": [
+ {
+ "start_timestamp": "2024-09-03T09:25:45.606Z",
+ "description": "",
+ "id": ";",
+ "keyword": "Scenario",
+ "line": 2,
+ "name": "This is an interesting scenario",
+ "steps": [
+ {
+ "keyword": "Given ",
+ "line": 3,
+ "match": {
+ "location": "SomeClass.java:-2"
+ },
+ "name": "this is the first step",
+ "result": {
+ "duration": 13244280571,
+ "status": "passed"
+ }
+ },
+ {
+ "keyword": "And ",
+ "line": 4,
+ "match": {
+ "location": "SomeClass.java:-2"
+ },
+ "name": "this is the second step",
+ "result": {
+ "duration": 5255261782,
+ "error_message": "This is the error message of step 2",
+ "status": "failed"
+ }
+ }
+ ],
+ "tags": [
+ {
+ "name": "@rerun"
+ }
+ ],
+ "type": "scenario"
+ }
+ ],
+ "id": "",
+ "keyword": "Feature",
+ "line": 1,
+ "name": "Rerun",
+ "uri": "features/rerun/rerun.feature"
+ },
+ {
+ "description": "This is a rerun feature",
+ "elements": [
+ {
+ "start_timestamp": "2024-09-03T09:26:13.625Z",
+ "description": "",
+ "id": ";",
+ "keyword": "Scenario",
+ "line": 2,
+ "name": "This is an interesting scenario",
+ "steps": [
+ {
+ "keyword": "Given ",
+ "line": 3,
+ "match": {
+ "location": "SomeClass.java:-2"
+ },
+ "name": "this is the first step",
+ "result": {
+ "duration": 12244280571,
+ "status": "passed"
+ }
+ },
+ {
+ "keyword": "And ",
+ "line": 4,
+ "match": {
+ "location": "SomeClass.java:-2"
+ },
+ "name": "this is the second step",
+ "result": {
+ "duration": 25155261782,
+ "status": "passed"
+ }
+ }
+ ],
+ "tags": [
+ {
+ "name": "@rerun"
+ }
+ ],
+ "type": "scenario"
+ }
+ ],
+ "id": "",
+ "keyword": "Feature",
+ "line": 1,
+ "name": "Rerun",
+ "uri": "features/rerun/rerun.feature"
+ }
+]
diff --git a/examples/maven-example/json/rerun/single.json b/examples/maven-example/json/rerun/single.json
new file mode 100644
index 00000000..40c95ea1
--- /dev/null
+++ b/examples/maven-example/json/rerun/single.json
@@ -0,0 +1,60 @@
+[
+ {
+ "line": 1,
+ "elements": [
+ {
+ "start_timestamp": "2024-09-03T09:00:23.668Z",
+ "line": 6,
+ "name": "Single Scenario",
+ "description": "",
+ "id": "shopping",
+ "type": "scenario",
+ "keyword": "Scenario",
+ "steps": [
+ {
+ "result": {
+ "duration": 467889821,
+ "status": "passed"
+ },
+ "line": 7,
+ "name": "I search for book \"Something\"",
+ "match": {
+ "arguments": [
+ {
+ "val": "Something",
+ "offset": 19
+ }
+ ],
+ "location": "MySteps.I_search(String)"
+ },
+ "keyword": "When "
+ },
+ {
+ "result": {
+ "duration": 1691629452,
+ "status": "passed"
+ },
+ "line": 8,
+ "name": "the results include \"Something\"",
+ "match": {
+ "arguments": [
+ {
+ "val": "Something",
+ "offset": 21
+ }
+ ],
+ "location": "MySteps.search_results_include(String)"
+ },
+ "keyword": "Then "
+ }
+ ]
+ }
+ ],
+ "name": "Vendor Shopping Cart",
+ "description": "I\u0027d like to be able to search for my favourite book",
+ "id": "vendor-shopping-cart",
+ "keyword": "Feature",
+ "uri": "classpath:org/ShoppingCart.feature",
+ "tags": []
+ }
+]
\ No newline at end of file
diff --git a/examples/maven-example/pom.xml b/examples/maven-example/pom.xml
index 04197140..57a563d7 100644
--- a/examples/maven-example/pom.xml
+++ b/examples/maven-example/pom.xml
@@ -6,7 +6,7 @@
blog.softwaretester
maven-example
- 3.7.1
+ 3.8.0
pom
@@ -37,7 +37,7 @@
- ${cucumber.report.json.location}
+ ${cucumber.report.json.location}/rerun
${generated.report.location}
@@ -63,7 +63,7 @@
- ALL_SCENARIOS
+ ALL_SCENARIOS
@@ -86,8 +86,8 @@
false
- true
- false
+ true
+ false
default
diff --git a/makefile b/makefile
index f59ab55a..4e982415 100644
--- a/makefile
+++ b/makefile
@@ -1,9 +1,16 @@
-build-and-test:
- ./mvnw clean install
- (cd examples/maven-example && ../../mvnw verify -e)
+build-and-test: build test
+.Phony: build-and-test
+build:
+ ./mvnw clean install -U -ntp
+.Phony: build
+
+test:
+ ./mvnw clean verify -U -ntp -f examples/maven-example/pom.xml
open examples/maven-example/target/cluecumber-report/index.html
+.Phony: test
show-versions:
./mvnw versions:display-dependency-updates -U -ntp
- ./mvnw versions:display-plugin-updates -U -ntp
\ No newline at end of file
+ ./mvnw versions:display-plugin-updates -U -ntp
+.Phony: show-versions
\ No newline at end of file
diff --git a/maven/pom.xml b/maven/pom.xml
index d8d512bb..cd32ea88 100644
--- a/maven/pom.xml
+++ b/maven/pom.xml
@@ -7,12 +7,13 @@
cluecumber-maven
maven-plugin
- 3.7.1
+ ${revision}
cluecumber-parent
com.trivago.rta
- 3.7.1
+ ${revision}
+ ../pom.xml
Cluecumber Maven
@@ -44,9 +45,9 @@
3.9.6
3.9.6
3.10.1
- 3.9.6
+ 3.9.9
1
- 3.10.1
+ 3.13.0
3.10.2
1.1.0
diff --git a/pom.xml b/pom.xml
index 88089c0c..817c8663 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
com.trivago.rta
cluecumber-parent
- 3.7.1
+ ${revision}
pom
Cluecumber Parent
@@ -16,11 +16,12 @@
engine
- maven
core
+ maven
+ 3.8.0
11
11
11
@@ -30,14 +31,17 @@
UTF-8
UTF-8
3.11.0
- 3.1.0
- 1.6.13
- 5.11.0-M2
- 5.12.0
- 3.1.0
- 3.2.1
- 3.5.0
- 3.11.0
+ 3.2.5
+ 1.7.0
+ 5.11.0
+ 5.13.0
+ 3.5.0
+ 3.3.1
+ 3.10.0
+ 3.1.1
+ 3.3.1
+ 3.1.3
+ 1.6.0
2017
@@ -130,8 +134,65 @@
maven-release-plugin
${maven-release-plugin.version}
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ ${maven-resources-plugin.version}
+
+
+ org.apache.maven.plugins
+ maven-install-plugin
+ ${maven-install-plugin.version}
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.5.0
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 3.6.3
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ flatten-maven-plugin
+ ${flatten-maven-plugin.version}
+
+ true
+ resolveCiFriendliesOnly
+
+
+
+ flatten
+ process-resources
+
+ flatten
+
+
+
+ flatten.clean
+ clean
+
+ clean
+
+
+
+
+