diff --git a/src/main/java/com/gdn/qa/util/reader/CucumberTestResultReader.java b/src/main/java/com/gdn/qa/util/reader/CucumberTestResultReader.java index 8d55bb9..ee168cc 100644 --- a/src/main/java/com/gdn/qa/util/reader/CucumberTestResultReader.java +++ b/src/main/java/com/gdn/qa/util/reader/CucumberTestResultReader.java @@ -29,12 +29,12 @@ Map> groupingScenariosByTestSuiteId(List> groupedFeature = new ConcurrentHashMap<>(); System.out.println("Populating scenarios from feature :"); - reports.parallelStream().forEach(feature -> { + reports.parallelStream().forEachOrdered(feature -> { System.out.println(feature.getName()); String summary = String.format("Feature : %s, %s", feature.getName(), feature.getDescription()); List steps = new ArrayList<>(); - feature.getElements().parallelStream().forEach(element -> { + feature.getElements().parallelStream().forEachOrdered(element -> { ScenarioData scenarioData = new ScenarioData(); if (element.getType().equalsIgnoreCase("background")) { steps.addAll(0, readSteps(element.getSteps())); diff --git a/src/test/java/com/gdn/qa/util/TestReadTags.java b/src/test/java/com/gdn/qa/util/TestReadTags.java index f5f0793..8d4dd23 100644 --- a/src/test/java/com/gdn/qa/util/TestReadTags.java +++ b/src/test/java/com/gdn/qa/util/TestReadTags.java @@ -5,8 +5,9 @@ import org.junit.Test; public class TestReadTags { - /* @Test + @Test public void testCucumberFromFolder() throws Exception { + long startTime = System.nanoTime(); String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php"; String devKey = "aa0eb2386227576295d65b753ab60a5f"; String projectName = "Surabaya"; @@ -22,10 +23,14 @@ public void testCucumberFromFolder() throws Exception { .setPlatFormName(platformName); BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath) .writeToTestLink(); + + long endTime = System.nanoTime(); + System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000); } -*//* + @Test public void testCucumberWithBackground() throws Exception { + long startTime = System.nanoTime(); String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php"; String devKey = "aa0eb2386227576295d65b753ab60a5f"; String projectName = "Surabaya"; @@ -41,10 +46,14 @@ public void testCucumberWithBackground() throws Exception { .setPlatFormName(platformName); BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath) .writeToTestLink(); - }*//* + + long endTime = System.nanoTime(); + System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000); + } @Test public void testCucumberWithFailure() throws Exception { + long startTime = System.nanoTime(); String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php"; String devKey = "aa0eb2386227576295d65b753ab60a5f"; String projectName = "Surabaya"; @@ -60,17 +69,21 @@ public void testCucumberWithFailure() throws Exception { .setPlatFormName(platformName); BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath) .writeToTestLink(); + + long endTime = System.nanoTime(); + System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000); } @Test public void testCucumberHuge() throws Exception { + long startTime = System.nanoTime(); String testlinkURL = "https://testlink.gdn-app.com/lib/api/xmlrpc/v1/xmlrpc.php"; String devKey = "aa0eb2386227576295d65b753ab60a5f"; String projectName = "Neo-Loyalty"; String testPlanName = "TEST"; String buildName = "Staging"; String platformName = "API"; - String cucumberPath = "/src/test/resources/cucumber-huge.json"; + String cucumberPath = "/src/test/resources/cucumber/cucumber-huge.json"; System.out.println(cucumberPath); TestLinkData testLinkData = new TestLinkData().setUrlTestlink(testlinkURL) .setDEVKEY(devKey) @@ -80,6 +93,9 @@ public void testCucumberHuge() throws Exception { .setPlatFormName(platformName); BadakReporter.getReader(SupportedReports.CUCUMBER, testLinkData, cucumberPath) .writeToTestLink(); - }*/ + + long endTime = System.nanoTime(); + System.out.println("Total execution time in second : " + (endTime - startTime) / 1000000000); + } }