diff --git a/pom.xml b/pom.xml index 68fd5e0..35a3d44 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.microfocus.adm.almoctane.bdd bdd2octane - 1.1.7-SNAPSHOT + 1.1.8-SNAPSHOT maven-plugin bdd2octane diff --git a/src/main/java/com/microfocus/bdd/Bdd2Octane.java b/src/main/java/com/microfocus/bdd/Bdd2Octane.java index 2735d80..98ddffa 100644 --- a/src/main/java/com/microfocus/bdd/Bdd2Octane.java +++ b/src/main/java/com/microfocus/bdd/Bdd2Octane.java @@ -124,6 +124,7 @@ public void run() throws IOException, XMLStreamException, InstantiationException } if (previousFeature != null && previousFeature != octaneFeature) { + previousFeature.setStarted(FileUtil.getFileCreationTime(file)); writeFeatureToXML(writer, previousFeature); } previousFeature = octaneFeature; @@ -150,6 +151,7 @@ public void run() throws IOException, XMLStreamException, InstantiationException count++; } if (previousFeature != null) { + previousFeature.setStarted(FileUtil.getFileCreationTime(file)); writeFeatureToXML(writer, previousFeature); previousFeature = null; } diff --git a/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java b/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java index 48579a8..95b4960 100644 --- a/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java +++ b/src/main/java/com/microfocus/bdd/CucumberJvmHandler.java @@ -192,9 +192,7 @@ public Optional getFeatureName(OctaneFeatureLocator... octaneFeatureLoca if (octaneFeatureLocator != null && octaneFeatureLocator.length > 0) { Optional octaneFeatureOpt; String classnamePart = classname; - while (classnamePart.contains("-")) { - int lastIndex = classnamePart.lastIndexOf("-"); - classnamePart = classnamePart.substring(0, lastIndex).trim(); + while (!classnamePart.isEmpty()) { try { octaneFeatureOpt = octaneFeatureLocator[0].getOctaneFeatureByName(classnamePart); } catch (IOException e) { @@ -203,6 +201,12 @@ public Optional getFeatureName(OctaneFeatureLocator... octaneFeatureLoca if (octaneFeatureOpt.isPresent()) { return Optional.of(classnamePart); } + if (classnamePart.contains("-")) { + int lastIndex = classnamePart.lastIndexOf("-"); + classnamePart = classnamePart.substring(0, lastIndex).trim(); + } else { + return Optional.of(classname); + } } } return Optional.of(classname); diff --git a/src/main/java/com/microfocus/bdd/FeatureFileLocator.java b/src/main/java/com/microfocus/bdd/FeatureFileLocator.java index bdc8d72..88d4dd1 100644 --- a/src/main/java/com/microfocus/bdd/FeatureFileLocator.java +++ b/src/main/java/com/microfocus/bdd/FeatureFileLocator.java @@ -176,10 +176,7 @@ private Optional tryToGetFeatureFileMeta(String featureName, St } private OctaneFeature parseFeatureFile(FeatureFileMeta featureFileMeta) { - OctaneFeature octaneFeature = GherkinDocumentUtil.generateSkeletonFeature(featureFileMeta); - String creationTime = FileUtil.getFileCreationTime(featureFileMeta.getFeatureFile()); - octaneFeature.setStarted(creationTime); - return octaneFeature; + return GherkinDocumentUtil.generateSkeletonFeature(featureFileMeta); } private void cacheScenarios(OctaneFeature octaneFeature, FeatureFileMeta meta) { diff --git a/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java b/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java index b08816e..bb76a3a 100644 --- a/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java +++ b/src/test/java/com/microfocus/bdd/it/Bdd2OctaneHandlerITCase.java @@ -97,8 +97,9 @@ public static List data() { {Framework.CUCUMBER_JVM, "src/test/resources/cucumber-jvm/3outlines/junit5_scenario_contain_hyphen_outline4.xml", "src/test/resources/features/robustgherkin_has_3_examples_feature_scenario_name_contain_hyphen.feature", "separateResults/cucumber-jvm-final14.xml", "**/separateResults/standard-cucumber-jvm-final14.xml"}, {Framework.CUCUMBER_JVM, "src/test/resources/cucumber-jvm/3outlines/junit5_scenario_outline_name_similar.xml", "src/test/resources/features/OutlineConfusion.feature", "separateResults/cucumber-jvm-final15.xml", "**/separateResults/standard-cucumber-jvm-final15.xml"}, //scenario outlines failed beforeClass case - {Framework.CUCUMBER_JVM, "src/test/resources/cucumber-jvm/3outlines/failed_scenario_outlines_without_any_failed_step_info.xml", "src/test/resources/features/check_payment_method_status.feature", "separateResults/cucumber-jvm-final16.xml", "**/separateResults/standard-cucumber-jvm-final16.xml"} - + {Framework.CUCUMBER_JVM, "src/test/resources/cucumber-jvm/3outlines/failed_scenario_outlines_without_any_failed_step_info.xml", "src/test/resources/features/check_payment_method_status.feature", "separateResults/cucumber-jvm-final16.xml", "**/separateResults/standard-cucumber-jvm-final16.xml"}, + //1 junit report + 3 feature files (Feature names contain hyphens and are partially same.) + {Framework.CUCUMBER_JVM, "src/test/resources/cucumber-jvm/separate-test17/junit.xml", "src/test/resources/features/ContainHyphens*.feature", "separateResults/cucumber-jvm-final17.xml", "**/separateResults/standard-cucumber-jvm-final17.xml"}, }); } diff --git a/src/test/java/com/microfocus/bdd/ut/FilesLocatorTest.java b/src/test/java/com/microfocus/bdd/ut/FilesLocatorTest.java index 5c551a0..cfe818c 100644 --- a/src/test/java/com/microfocus/bdd/ut/FilesLocatorTest.java +++ b/src/test/java/com/microfocus/bdd/ut/FilesLocatorTest.java @@ -68,6 +68,6 @@ public void matchPatternFailTest() { public void matchPatternPassTest() { final String pattern = "src/**/*junit*.xml"; List reports = FilesLocator.getReportFiles(pattern); - Assert.assertEquals(23, reports.size()); + Assert.assertEquals(24, reports.size()); } } diff --git a/src/test/resources/cucumber-jvm/separate-test17/junit.xml b/src/test/resources/cucumber-jvm/separate-test17/junit.xml new file mode 100644 index 0000000..3d5d788 --- /dev/null +++ b/src/test/resources/cucumber-jvm/separate-test17/junit.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/features/ContainHyphensFooterUIValidations.feature b/src/test/resources/features/ContainHyphensFooterUIValidations.feature new file mode 100644 index 0000000..1c57c97 --- /dev/null +++ b/src/test/resources/features/ContainHyphensFooterUIValidations.feature @@ -0,0 +1,16 @@ +#Auto generated Octane revision tag +@BSPID174090REV0.18.0 +Feature: MyAccount - Footer + + @TSCID523715 @TemenosReactTeam + Scenario: Verify Footer - Our Fees Hyperlink + Given User logs into My Account with a policy + When User clicks on "Our Fees" link in My Account Footer + Then User should be navigated to the respective footer page + @TSCID523721 @TemenosReactTeam + Scenario: Verify Footer - Important Information About Us Hyperlink + Given User login into My Account with Multi Product Policies + |Bike | 1 | + |Van | 1 | + When User clicks on "Important Information About Us" link in My Account Footer + Then User should be navigated to the respective footer page \ No newline at end of file diff --git a/src/test/resources/features/ContainHyphensGoGreenOverlayUiValidations.feature b/src/test/resources/features/ContainHyphensGoGreenOverlayUiValidations.feature new file mode 100644 index 0000000..52f9e81 --- /dev/null +++ b/src/test/resources/features/ContainHyphensGoGreenOverlayUiValidations.feature @@ -0,0 +1,9 @@ +#Auto generated Octane revision tag +@BSPID182030REV0.12.0 +Feature: MyAccount - Footer - GoGreen Overlay Ui Validations + + @TSCID545389 @TemenosReactTeam + Scenario: Verify the Help us go green modal overlay for postal document delivery in My Account + Given User logs into My Account with Postal document delivery method policy + When User is on Dashboard screen for Go Green Modal + Then User should be presented with Help us go green modal overlay \ No newline at end of file diff --git a/src/test/resources/features/ContainHyphensHelpUIValidation.feature b/src/test/resources/features/ContainHyphensHelpUIValidation.feature new file mode 100644 index 0000000..8b2d001 --- /dev/null +++ b/src/test/resources/features/ContainHyphensHelpUIValidation.feature @@ -0,0 +1,9 @@ +#Auto generated Octane revision tag +@BSPID183048REV0.5.0 +Feature: MyAccount - Footer - Help UI Validation + + @TSCID564947 @TemenosReactTeam + Scenario: Verify Help page on My Account + Given User logs into My Account with a policy + When User clicks on Help button + Then User should be directed to the Hastings Direct Help page \ No newline at end of file diff --git a/src/test/resources/standardOctaneGherkinReport/multipleDifferentResults/standard-multipleDifferent-cucumber-js-final.xml b/src/test/resources/standardOctaneGherkinReport/multipleDifferentResults/standard-multipleDifferent-cucumber-js-final.xml index 670b8f1..c47ef5b 100644 --- a/src/test/resources/standardOctaneGherkinReport/multipleDifferentResults/standard-multipleDifferent-cucumber-js-final.xml +++ b/src/test/resources/standardOctaneGherkinReport/multipleDifferentResults/standard-multipleDifferent-cucumber-js-final.xml @@ -1,7 +1,7 @@ + path="src\test\resources\features\robustgherkin.feature" started="1685009046862" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin03.feature" started="1685009046862" tag="BSPID1037REV0.0.1"> - + - + + path="src\test\resources\features\robustgherkin.feature" started="1685009046861" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046862" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046866" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046866" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046885" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046885" tag="BSPID1001REV0.0.1"> - + - + + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046890" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046890" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046892" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\StandardRobustGherkin.feature" started="1685009046892" tag="BSPID1001REV0.0.1"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046867" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046867" tag="BSPID1001REV0.2.0"> - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/standardOctaneGherkinReport/separateResults/standard-cucumber-jvm-final2.xml b/src/test/resources/standardOctaneGherkinReport/separateResults/standard-cucumber-jvm-final2.xml index 2c2b452..84b4d82 100644 --- a/src/test/resources/standardOctaneGherkinReport/separateResults/standard-cucumber-jvm-final2.xml +++ b/src/test/resources/standardOctaneGherkinReport/separateResults/standard-cucumber-jvm-final2.xml @@ -1,7 +1,7 @@ + path="src\test\resources\features\robustgherkin.feature" started="1685009046868" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046868" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046869" tag="BSPID1001REV0.2.0"> - + - + - + - + - + - + - + - + - + - + - + + path="src\test\resources\features\robustgherkin03.feature" started="1685009046862" tag="BSPID1037REV0.0.1"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046866" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046877" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin.feature" started="1685009046885" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\dealer.feature" started="1685009046889" tag="BSPID1001REV0.2.0"> + path="src\test\resources\features\robustgherkin03.feature" started="1685009046892" tag="BSPID1037REV0.0.1">