@@ -31,8 +31,7 @@ public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String
3131 initReportTemplate ();
3232 for (ISuite suite : suites ) {
3333 Map <String , ISuiteResult > suiteResults = suite .getResults ();
34- for (String testName : suiteResults .keySet ()) {
35- ISuiteResult suiteResult = suiteResults .get (testName );
34+ suiteResults .forEach ((testName , suiteResult ) -> {
3635 ITestContext testContext = suiteResult .getTestContext ();
3736
3837 IResultMap failedResult = testContext .getFailedTests ();
@@ -52,8 +51,7 @@ public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String
5251 for (ITestResult testResult : testsSkipped ) {
5352 reportWriter .println (String .format (resultRow , "warning" , suite .getName (), testName , testResult .getName (), "SKIPPED" , "NA" ));
5453 }
55-
56- }
54+ });
5755 }
5856 finishReportTemplate ();
5957 reportWriter .flush ();
@@ -62,8 +60,8 @@ public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String
6260
6361 private void initReportTemplate () {
6462 reportWriter .println (
65- "<html>" + "<head>" + "<title>My Custom Report</title>" + "<meta name=\" viewport\" content=\" width=device-width, initial-scale=1\" >" + "<link rel=\" stylesheet\" href=\" https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" >"
66- + "<script src=\" https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js\" ></script>" + "<script src=\" https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" ></script></head>" + "<body><div class=\" container\" >" );
63+ "<html>" + "<head>" + "<title>My Custom Report</title>" + "<meta name=\" viewport\" content=\" width=device-width, initial-scale=1\" >" + "<link rel=\" stylesheet\" href=\" https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" >"
64+ + "<script src=\" https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js\" ></script>" + "<script src=\" https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" ></script></head>" + "<body><div class=\" container\" >" );
6765 reportWriter .println ("<table class=\" table\" ><thead><tr>" + "<th>Suite</th>" + "<th>Test</th>" + "<th>Method</th>" + "<th>Status</th>" + "<th>Execution Time(ms)</th>" + "</tr></thead> <tbody>" );
6866 }
6967
0 commit comments