├── .gitignore ├── LICENSE ├── README.md ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── github │ │ │ ├── exception │ │ │ └── ReportConfigException.java │ │ │ ├── internal │ │ │ ├── HtmlBuilder.java │ │ │ └── Utils.java │ │ │ └── testng │ │ │ └── MetricsListener.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.testng.ITestNGListener └── test │ └── java │ └── com │ └── github │ └── functional │ ├── FunctionalSample.java │ ├── ParallelClassesTestOne.java │ ├── ParallelClassesTestTwo.java │ ├── ParallelMethodTest.java │ └── ParallelSuiteTest.java ├── test-output ├── Suite │ ├── Test.html │ ├── Test.xml │ └── testng-failed.xml ├── Test-class Suite │ ├── Test-class test 1.html │ ├── Test-class test 1.xml │ ├── Test-class test 2.html │ ├── Test-class test 2.xml │ ├── Test-class test.html │ └── Test-class test.xml ├── Test-method Suite │ ├── Test-method test.html │ └── Test-method test.xml ├── bullet_point.png ├── collapseall.gif ├── emailable-report.html ├── failed.png ├── index.html ├── index1.html ├── jquery-1.7.1.min.js ├── junitreports │ ├── TEST-com.github.functional.ParallelClassesTestOne.xml │ ├── TEST-com.github.functional.ParallelClassesTestTwo.xml │ ├── TEST-com.github.functional.ParallelMethodTest.xml │ └── TEST-com.github.functional.ParallelSuiteTest.xml ├── navigator-bullet.png ├── old │ ├── Suite │ │ ├── Test.properties │ │ ├── classes.html │ │ ├── groups.html │ │ ├── index.html │ │ ├── main.html │ │ ├── methods-alphabetical.html │ │ ├── methods-not-run.html │ │ ├── methods.html │ │ ├── reporter-output.html │ │ ├── testng.xml.html │ │ └── toc.html │ ├── Test-class Suite │ │ ├── Test-class test 1.properties │ │ ├── Test-class test 2.properties │ │ ├── Test-class test.properties │ │ ├── classes.html │ │ ├── groups.html │ │ ├── index.html │ │ ├── main.html │ │ ├── methods-alphabetical.html │ │ ├── methods-not-run.html │ │ ├── methods.html │ │ ├── reporter-output.html │ │ ├── testng.xml.html │ │ └── toc.html │ ├── Test-method Suite │ │ ├── Test-method test.properties │ │ ├── classes.html │ │ ├── groups.html │ │ ├── index.html │ │ ├── main.html │ │ ├── methods-alphabetical.html │ │ ├── methods-not-run.html │ │ ├── methods.html │ │ ├── reporter-output.html │ │ ├── testng.xml.html │ │ └── toc.html │ └── index.html ├── parallel_classes_09_May_20_08_40_33.html ├── parallel_methods_09_May_20_08_41_05.html ├── parallel_tests_09_May_20_08_41_41.html ├── passed.png ├── skipped.png ├── testng-failed.xml ├── testng-reports.css ├── testng-reports.js ├── testng-results.xml ├── testng.css └── testng_metrics.html └── testng_xml ├── classes-test-testng.xml ├── methods-test-testng.xml.xml ├── suite-test-testng.xml └── testng.xml /.gitignore: -------------------------------------------------------------------------------- 1 | hs_err_pid* 2 | *.jar 3 | .settings/ 4 | .project 5 | .classpath 6 | test-output/ 7 | target/ 8 | *.swp 9 | bin/ 10 | logs/ 11 | *.DS_Store 12 | .idea/ 13 | *.iml 14 | .metadata 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | /*/build/ 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Shiva Prasad Adirala 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TestNg Metrics Report 2 | 3 | > TestNg Metrics is a custom report generated using TestNG Listener. Which generate awesome html report without making any changes in your existing automation code 4 | 5 | ![Maven Central](https://img.shields.io/maven-central/v/com.github.adiralashiva8/testng-metrics.svg?label=Maven%20Central) 6 | ![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square) 7 | ![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg) 8 | ![Open Source Love png1](https://badges.frapsoft.com/os/v1/open-source.png?v=103) 9 | [![HitCount](http://hits.dwyl.io/adiralashiva8/testng-metrics.svg)](http://hits.dwyl.io/adiralashiva8/testng-metrics) 10 | 11 | --- 12 | 13 | - __Sample Report__ [link](https://testng-metrics.netlify.com/) 14 | > Best viewed in desktop! 15 | 16 | --- 17 | 18 | ### Key Features 19 | 20 | - Dashboard View of execution results 21 | - Top 10 Test Performances 22 | - Sort and Search Results 23 | - Export Results (pdf, excel, csv, print) 24 | - No Code changes required 25 | - Metrics of `After*` and `Before*` 26 | - Display dataprovider info for tests 27 | 28 | --- 29 | 30 | ### Pre-requisite 31 | 32 | - JDK 8+ 33 | - TestNG 6+ 34 | 35 | --- 36 | 37 | ### How to use in Project: 38 | 39 | ### Maven: 40 | 41 | 1. Add testng-metrics dependency in pom.xml 42 | ``` 43 | 44 | com.github.adiralashiva8 45 | testng-metrics 46 | 1.6 47 | 48 | ``` 49 | 2. Perform maven install 50 | 51 | 3. Execute test cases 52 | 53 | 4. TestNg Metrics report file will be created 54 | > By default report will be generated at TestNG's output directory. i.e., `test-output/metric.html` 55 | 56 | --- 57 | 58 | ### Not a Maven Project? 59 | 60 | 1. Download `testng-metrics.jar` from [here](https://oss.sonatype.org/service/local/repositories/releases/content/com/github/adiralashiva8/testng-metrics/1.6/testng-metrics-1.6.jar) 61 | 62 | 2. Add `testng-metrics.jar` in your project 63 | > - Open Eclipse → Right click on the project 64 | > - Go to Property → Build Path → Configure Build Path 65 | > - Add the `testng-metrics.jar` in the libraries using Add External Jar button 66 | 67 | 3. Execute test cases 68 | 69 | 4. TestNg Metrics report will be generated 70 | 71 | --- 72 | 73 | ### Customize Report: 74 | 75 | - __Custom Logo__: Logo can be modified by modifying: 76 | 77 | > `testng.metrics.report.logo` parameter value in `testng.xml` 78 | 79 | Example: 80 | ``` 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | ``` 90 | 91 | 92 | - __Custom Report Name__: Similar to __Custom Logo__ user can be modify report name by modifying: 93 | 94 | > `testng.metrics.report.name` parameter value in `testng.xml` 95 | 96 | Example: 97 | ``` 98 | 99 | ``` 100 | > This helps in create different reports for different cases 101 | 102 | 103 | - __Report With Timestamp__: Helps to create new file by appending timestamp to report every time 104 | 105 | > `testng.metrics.report.appendTimestamp` parameter value in `testng.xml` 106 | 107 | Example: 108 | ``` 109 | 110 | ``` 111 | 112 | --- 113 | 114 | Thanks for using testng-metrics! 115 | 116 | - What is your opinion of this report? 117 | - What’s the feature I should add? 118 | 119 | If you have any questions / suggestions / comments on the report, please feel free to reach me at 120 | 121 | - Email: `adiralashiva8@gmail.com` 122 | - LinkedIn: `shivaprasadadirala` 123 | - Twitter: `@ShivaAdirala` 124 | - Mailing List (google group): `testng-metrics` 125 | 126 | --- 127 | 128 | *Special Thanks To:* 129 | 130 | *Contributors:* 131 | 132 | 1. [Krishnan Mahadevan](https://www.linkedin.com/in/krmahadevan/) 133 | > - Mavenised the project ( To consume it from Maven library ) 134 | > - Converted the utility into a TestNg listener 135 | > - Guided to publish the library into Maven Central 136 | 137 | 2. [Saurabh Gupta](https://www.linkedin.com/in/saurabh-gupta-24769929/) 138 | > - Contributed source to display data-provider info in Test Metrics 139 | > - Added brand LOGO for TestNG Metrics 140 | 141 | 3. [Nainappa Illi](https://www.linkedin.com/in/nainappa-illi-97673231/) 142 | > - Contributed source to archive test-output folder and display execution time 143 | 144 | *Feedback:* 145 | 146 | 1. [Venkateswara Reddy G](https://www.linkedin.com/in/gvreddyreddy/) 147 | 148 | 2. [Shyam]() 149 | 150 | 2. [Testng Users Community](https://groups.google.com/forum/#!forum/testng-users) 151 | 152 | --- 153 | 154 | > :star: repo if you like it 155 | 156 | --- 157 | 158 | Inspired from [robotframework-metrics](https://github.com/adiralashiva8/robotframework-metrics) 159 | 160 | --- 161 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.sonatype.oss 7 | oss-parent 8 | 9 9 | 10 | 11 | com.github.adiralashiva8 12 | testng-metrics 13 | 1.6 14 | jar 15 | 16 | TestNG Metrics 17 | A HTML Report of test executions via TestNG 18 | http://maven.apache.org 19 | 20 | 21 | UTF-8 22 | 23 | 24 | 25 | 26 | The Apache Software License, Version 2.0 27 | http://www.apache.org/licenses/LICENSE-2.0.txt 28 | repo 29 | 30 | 31 | 32 | 33 | scm:git:git@github.com:adiralashiva8/testng-metrics.git 34 | scm:git:git@github.com:adiralashiva8/testng-metrics.git 35 | https://github.com/adiralashiva8/testng-metrics 36 | 37 | 38 | 39 | adiralashiva8 40 | Shiva Prasad Adirala 41 | https://adiralashiva8.github.io/ 42 | 43 | Owner 44 | 45 | 46 | 47 | 48 | 49 | https://github.com/adiralashiva8/testng-metrics/issues 50 | GitHub Issues 51 | 52 | 53 | 54 | 55 | org.testng 56 | testng 57 | 7.0.0-beta3 58 | 59 | 60 | 61 | 62 | 63 | ossrh 64 | https://oss.sonatype.org/content/repositories/snapshots 65 | 66 | 67 | ossrh 68 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 69 | 70 | 71 | 72 | 73 | 74 | org.sonatype.plugins 75 | nexus-staging-maven-plugin 76 | 1.6.3 77 | true 78 | 79 | ossrh 80 | https://oss.sonatype.org/ 81 | true 82 | 83 | 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-source-plugin 88 | 2.2.1 89 | 90 | 91 | attach-sources 92 | 93 | jar-no-fork 94 | 95 | 96 | 97 | 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-javadoc-plugin 102 | 2.10.3 103 | 104 | 105 | attach-javadocs 106 | 107 | jar 108 | 109 | 110 | 111 | 112 | 113 | 114 | org.apache.maven.plugins 115 | maven-gpg-plugin 116 | 1.6 117 | 118 | 119 | sign-artifacts 120 | verify 121 | 122 | sign 123 | 124 | 125 | 126 | 127 | 128 | 129 | org.apache.maven.plugins 130 | maven-compiler-plugin 131 | 3.1 132 | 133 | 1.8 134 | 1.8 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/main/java/com/github/exception/ReportConfigException.java: -------------------------------------------------------------------------------- 1 | package com.github.exception; 2 | 3 | import java.io.Serializable; 4 | 5 | public class ReportConfigException extends RuntimeException implements Serializable { 6 | 7 | private static final long serialVersionUID = -3644742957748395150L; 8 | 9 | public ReportConfigException() { 10 | super(); 11 | } 12 | 13 | public ReportConfigException(String msg) { 14 | super(msg); 15 | } 16 | 17 | /** 18 | * For wrapping up exception 19 | * 20 | * @param message Error message 21 | * @param cause Error cause 22 | */ 23 | public ReportConfigException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/github/internal/Utils.java: -------------------------------------------------------------------------------- 1 | package com.github.internal; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.HashSet; 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.Set; 10 | import org.testng.IResultMap; 11 | import org.testng.ISuite; 12 | import org.testng.ISuiteResult; 13 | import org.testng.ITestContext; 14 | import org.testng.ITestResult; 15 | import org.testng.collections.Lists; 16 | import org.testng.collections.Maps; 17 | import org.testng.collections.Sets; 18 | import org.testng.reporters.Files; 19 | 20 | public class Utils { 21 | 22 | public static class ExecutionResults { 23 | private int passed = 0; 24 | private int failed = 0; 25 | private int skipped = 0; 26 | private int ignored = 0; 27 | private int retried = 0; 28 | 29 | /*int getTotal() { 30 | return getPassed() + getFailed() + getSkipped() + getIgnored() + getRetried(); 31 | }*/ 32 | int getTotal() { 33 | return getPassed() + getFailed() + getSkipped() + getRetried(); 34 | } 35 | 36 | int getPassed() { 37 | return passed; 38 | } 39 | 40 | int getFailed() { 41 | return failed; 42 | } 43 | 44 | int getSkipped() { 45 | return skipped; 46 | } 47 | 48 | int getIgnored() { 49 | return ignored; 50 | } 51 | 52 | int getRetried() { 53 | return retried; 54 | } 55 | } 56 | 57 | public static ExecutionResults computeOverResults(List suites) { 58 | // Calculate passed/failed/skipped 59 | ExecutionResults results = new ExecutionResults(); 60 | for (ISuite s : suites) { 61 | Map suiteResults = s.getResults(); 62 | for (ISuiteResult sr : suiteResults.values()) { 63 | ITestContext testContext = sr.getTestContext(); 64 | results.passed += testContext.getPassedTests().size(); 65 | results.failed += testContext.getFailedTests().size(); 66 | int retriedPerTest = 0; 67 | int skippedPerTest = 0; 68 | for (ITestResult result : testContext.getSkippedTests().getAllResults()) { 69 | if (result.getAttribute("retried") != null) { 70 | retriedPerTest++; 71 | } else { 72 | skippedPerTest++; 73 | } 74 | } 75 | results.skipped += skippedPerTest; 76 | results.retried += retriedPerTest; 77 | results.ignored += testContext.getExcludedMethods().size(); 78 | } 79 | } 80 | return results; 81 | } 82 | 83 | public static void writeToFile(String outputDirectory, String fileContent, String fileName) throws IOException { 84 | String tempFile = outputDirectory + File.separator + fileName; 85 | File file = new File(tempFile); 86 | Files.writeFile(fileContent, file); 87 | // write to file with OutputStreamWriter 88 | System.out.println("TestNG Metrics " + fileName + " is created successfully"); 89 | } 90 | 91 | static Map> asMap(Set testResults) { 92 | Map> map = Maps.newHashMap(); 93 | for (ITestResult result : testResults) { 94 | String className = result.getTestClass().getName(); 95 | List list = map.computeIfAbsent(className, k -> Lists.newArrayList()); 96 | list.add(result); 97 | } 98 | return map; 99 | } 100 | 101 | static Set extractResults(ISuiteResult suiteResult) { 102 | Set testResults = Sets.newHashSet(); 103 | ITestContext testContext = suiteResult.getTestContext(); 104 | testResults.addAll(addAllTestResults(testContext.getPassedTests())); 105 | testResults.addAll(addAllTestResults(testContext.getFailedTests())); 106 | testResults.addAll(addAllTestResults(testContext.getSkippedTests())); 107 | testResults.addAll(addAllTestResults(testContext.getPassedConfigurations())); 108 | testResults.addAll(addAllTestResults(testContext.getSkippedConfigurations())); 109 | testResults.addAll(addAllTestResults(testContext.getFailedConfigurations())); 110 | testResults.addAll(addAllTestResults(testContext.getFailedButWithinSuccessPercentageTests())); 111 | return testResults; 112 | } 113 | 114 | static String getStatusString(ITestResult result) { 115 | int testResultStatus = result.getStatus(); 116 | switch (testResultStatus) { 117 | case ITestResult.SUCCESS: 118 | return "PASS"; 119 | case ITestResult.FAILURE: 120 | return "FAIL"; 121 | case ITestResult.SKIP: 122 | return "SKIP"; 123 | case ITestResult.SUCCESS_PERCENTAGE_FAILURE: 124 | return "SUCCESS_PERCENTAGE_FAILURE"; 125 | default: 126 | throw new AssertionError("Unexpected value: " + testResultStatus); 127 | } 128 | } 129 | 130 | private static Set addAllTestResults(IResultMap resultMap) { 131 | if (resultMap == null) { 132 | return Sets.newHashSet(); 133 | } 134 | 135 | List temp = new ArrayList<>(resultMap.getAllResults()); 136 | temp.sort((o1, o2) -> (int) (o1.getStartMillis() - o2.getStartMillis())); 137 | 138 | return new HashSet<>(temp); 139 | } 140 | 141 | 142 | } 143 | -------------------------------------------------------------------------------- /src/main/java/com/github/testng/MetricsListener.java: -------------------------------------------------------------------------------- 1 | package com.github.testng; 2 | 3 | import java.io.IOException; 4 | import java.lang.reflect.Method; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Collection; 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | import org.testng.IReporter; 11 | import org.testng.ISuite; 12 | import org.testng.ISuiteResult; 13 | import org.testng.ITestContext; 14 | import org.testng.ITestListener; 15 | import org.testng.ITestResult; 16 | import org.testng.TestNG; 17 | import org.testng.xml.XmlSuite; 18 | 19 | import com.github.internal.HtmlBuilder; 20 | import com.github.internal.Utils; 21 | import com.github.internal.Utils.ExecutionResults; 22 | 23 | public class MetricsListener implements IReporter, ITestListener { 24 | private StringBuilder builder = new StringBuilder(); 25 | private static String outdir; 26 | private static String metricsLogo; 27 | private static String metricsFileName; 28 | private static String metricsAppendTimeStamp; 29 | 30 | @Override 31 | public void generateReport(List xmlSuites, List suites, 32 | String outputDirectory) { 33 | ExecutionResults results = Utils.computeOverResults(suites); 34 | builder.append(HtmlBuilder.buildHeaderAndTitle()); 35 | builder.append(HtmlBuilder.buildDashBoard(results, metricsLogo)); 36 | suites.forEach(this::generateReport); 37 | builder.append(HtmlBuilder.buildLogsTab()); 38 | builder.append(HtmlBuilder.buildScriptContent()); 39 | try { 40 | Utils.writeToFile(outputDirectory, builder.toString(), metricsFileName); 41 | } catch (IOException e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | 46 | private void generateReport(ISuite suite) { 47 | generateClassMetrics(suite); 48 | generateTestMetrics(suite); 49 | generateMethodMetrics(suite); 50 | } 51 | 52 | private void generateClassMetrics(ISuite suite){ 53 | Collection suiteResults = suite.getResults().values(); 54 | int index = 0; 55 | int size = suiteResults.size(); 56 | for (ISuiteResult suiteResult : suiteResults) { 57 | if (index == 0) { 58 | builder.append(HtmlBuilder.appendClassMetricsHeader()); 59 | } 60 | builder.append(HtmlBuilder.buildClassMetrics(suiteResult)); 61 | if (index == size-1) { 62 | builder.append(HtmlBuilder.appendMetricsFooter()); 63 | } 64 | index++; 65 | } 66 | } 67 | 68 | private void generateTestMetrics(ISuite suite){ 69 | Collection suiteResults = suite.getResults().values(); 70 | int index = 0; 71 | int size = suiteResults.size(); 72 | long totalTime = 0; 73 | for (ISuiteResult eachRslt : suite.getResults().values()) { 74 | ITestContext ctx = eachRslt.getTestContext(); 75 | Date start = ctx.getStartDate(); 76 | Date end = ctx.getEndDate(); 77 | long ms = end.getTime() - start.getTime(); 78 | totalTime += ms; 79 | } 80 | long secs = totalTime / 1000; 81 | String executionTimeFormat = String.format("%02d:%02d:%02d", secs / 3600, (secs % 3600) / 60, secs % 60); 82 | 83 | for (ISuiteResult suiteResult : suiteResults) { 84 | if (index == 0) { 85 | builder.append(HtmlBuilder.appendTestMetricsHeader(executionTimeFormat)); 86 | } 87 | builder.append(HtmlBuilder.buildTestMetricsTab(suiteResult)); 88 | if (index == size-1) { 89 | builder.append(HtmlBuilder.appendMetricsFooter()); 90 | } 91 | index++; 92 | } 93 | 94 | } 95 | 96 | private void generateMethodMetrics(ISuite suite){ 97 | Collection suiteResults = suite.getResults().values(); 98 | int index = 0; 99 | int size = suiteResults.size(); 100 | for (ISuiteResult suiteResult : suiteResults) { 101 | if (index == 0) { 102 | builder.append(HtmlBuilder.appendMethodMetricsHeader()); 103 | } 104 | builder.append(HtmlBuilder.buildMethodMetricsTab(suiteResult)); 105 | if (index == size-1) { 106 | builder.append(HtmlBuilder.appendMetricsFooter()); 107 | } 108 | index++; 109 | } 110 | } 111 | 112 | @Override 113 | public void onStart(ITestContext context) { 114 | metricsLogo = context.getCurrentXmlTest().getParameter("testng.metrics.report.logo"); 115 | metricsFileName = context.getCurrentXmlTest().getParameter("testng.metrics.report.name"); 116 | metricsAppendTimeStamp = context.getCurrentXmlTest().getParameter("testng.metrics.report.appendTimestamp"); 117 | 118 | if (metricsFileName==null) { 119 | metricsFileName = "testng_metrics.html"; 120 | } 121 | 122 | if (metricsLogo==null) { 123 | metricsLogo = "https://i.ibb.co/9qBkwDF/Testing-Fox-Logo.png"; 124 | } 125 | 126 | if (metricsAppendTimeStamp != null) { 127 | if (metricsAppendTimeStamp.equalsIgnoreCase("true")) { 128 | String[] desiredText = metricsFileName.split(".html"); 129 | metricsFileName = desiredText[0] + "_" + new SimpleDateFormat("dd_MMM_yy_hh_mm_ss").format(new Date()) + ".html"; 130 | } 131 | } 132 | System.out.println(""); 133 | System.out.println("Logo: " + metricsLogo); 134 | System.out.println("File name: " + metricsFileName); 135 | System.out.println("Append timestamp?: " + metricsAppendTimeStamp); 136 | System.out.println("File name(timestamp): " + metricsFileName); 137 | System.out.println(""); 138 | } 139 | 140 | @SuppressWarnings("deprecation") 141 | @Override 142 | public void onFinish(ITestContext context) { 143 | Method customizedFinish; 144 | try { 145 | customizedFinish = TestNG.class.getMethod("getOutputDirectory"); 146 | Object customObject[] = {}; 147 | outdir = (String) customizedFinish.invoke(TestNG.getDefault(), customObject); 148 | 149 | } catch (Exception exception) { 150 | exception.printStackTrace(); 151 | } 152 | } 153 | 154 | @Override 155 | public void onTestStart(ITestResult result) { 156 | // not implemented 157 | } 158 | 159 | @Override 160 | public void onTestSuccess(ITestResult result) { 161 | // not implemented 162 | } 163 | 164 | @Override 165 | public void onTestFailure(ITestResult result) { 166 | // not implemented 167 | } 168 | 169 | @Override 170 | public void onTestSkipped(ITestResult result) { 171 | // not implemented 172 | } 173 | 174 | @Override 175 | public void onTestFailedButWithinSuccessPercentage(ITestResult result) { 176 | // not implemented 177 | } 178 | 179 | @Override 180 | public void onTestFailedWithTimeout(ITestResult result) { 181 | onTestFailure(result); 182 | } 183 | 184 | public static String getOutdir() { 185 | return outdir; 186 | } 187 | 188 | } 189 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/org.testng.ITestNGListener: -------------------------------------------------------------------------------- 1 | com.github.testng.MetricsListener -------------------------------------------------------------------------------- /src/test/java/com/github/functional/FunctionalSample.java: -------------------------------------------------------------------------------- 1 | package com.github.functional; 2 | 3 | import org.testng.Assert; 4 | import org.testng.annotations.AfterClass; 5 | import org.testng.annotations.BeforeClass; 6 | import org.testng.annotations.DataProvider; 7 | import org.testng.annotations.Parameters; 8 | import org.testng.annotations.Test; 9 | 10 | public class FunctionalSample { 11 | 12 | @BeforeClass 13 | @Parameters({ "sUsername", "sPassword" }) 14 | public void beforeClass(String sUsername, String sPassword) { 15 | try { 16 | Thread.sleep(5000); 17 | } catch (InterruptedException e) { 18 | // TODO Auto-generated catch block 19 | e.printStackTrace(); 20 | } 21 | } 22 | 23 | @AfterClass 24 | public void afterClass() { 25 | try { 26 | Thread.sleep(5000); 27 | } catch (InterruptedException e) { 28 | // TODO Auto-generated catch block 29 | e.printStackTrace(); 30 | } 31 | } 32 | 33 | @Test 34 | public void passingTest() { 35 | try { 36 | Thread.sleep(5000); 37 | } catch (InterruptedException e) { 38 | // TODO Auto-generated catch block 39 | e.printStackTrace(); 40 | } 41 | } 42 | 43 | @Test 44 | public void failingTest() { 45 | try { 46 | Thread.sleep(2000); 47 | } catch (InterruptedException e) { 48 | // TODO Auto-generated catch block 49 | e.printStackTrace(); 50 | } 51 | Assert.assertEquals("TestNG", "Metrics"); 52 | } 53 | 54 | @Test(dependsOnMethods = {"failingTest"}) 55 | public void skippingTest() { 56 | try { 57 | Thread.sleep(10000); 58 | } catch (InterruptedException e) { 59 | // TODO Auto-generated catch block 60 | e.printStackTrace(); 61 | } 62 | } 63 | 64 | @DataProvider(name = "dataProviderTest") 65 | public static Object[][] credentials() { 66 | return new Object[][] { { "testuser_1", "Test@123" }, { "testuser_2", "Test@321" } }; 67 | } 68 | 69 | @Test(dataProvider = "dataProviderTest") 70 | public void dataProviderTest(String sUsername, String sPassword) { 71 | try { 72 | Thread.sleep(5000); 73 | } catch (InterruptedException e) { 74 | // TODO Auto-generated catch block 75 | e.printStackTrace(); 76 | } 77 | if (sUsername.contentEquals("testuser_2")) { 78 | Assert.assertEquals("TestNG", "TestNGMetrics"); 79 | 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/test/java/com/github/functional/ParallelClassesTestOne.java: -------------------------------------------------------------------------------- 1 | package com.github.functional; 2 | 3 | import org.testng.annotations.AfterClass; 4 | import org.testng.annotations.BeforeClass; 5 | import org.testng.annotations.Test; 6 | 7 | public class ParallelClassesTestOne { 8 | 9 | // Credits of these test cases - https://howtodoinjava.com/testng/testng-executing-parallel-tests/ 10 | 11 | @BeforeClass 12 | public void beforeClass() { 13 | long id = Thread.currentThread().getId(); 14 | System.out.println("Before test-class. Thread id is: " + id); 15 | } 16 | 17 | @Test 18 | public void testMethodOne() { 19 | long id = Thread.currentThread().getId(); 20 | System.out.println("Sample test-method One. Thread id is: " + id); 21 | } 22 | 23 | @Test 24 | public void testMethodTwo() { 25 | long id = Thread.currentThread().getId(); 26 | System.out.println("Sample test-method Two. Thread id is: " + id); 27 | } 28 | 29 | @AfterClass 30 | public void afterClass() { 31 | long id = Thread.currentThread().getId(); 32 | System.out.println("After test-class. Thread id is: " + id); 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/java/com/github/functional/ParallelClassesTestTwo.java: -------------------------------------------------------------------------------- 1 | package com.github.functional; 2 | 3 | import org.testng.annotations.AfterClass; 4 | import org.testng.annotations.BeforeClass; 5 | import org.testng.annotations.Test; 6 | 7 | public class ParallelClassesTestTwo { 8 | 9 | // Credits of these test cases - https://howtodoinjava.com/testng/testng-executing-parallel-tests/ 10 | 11 | @BeforeClass 12 | public void beforeClass() { 13 | long id = Thread.currentThread().getId(); 14 | System.out.println("Before test-class. Thread id is: " + id); 15 | } 16 | 17 | @Test 18 | public void testMethodOne() { 19 | long id = Thread.currentThread().getId(); 20 | System.out.println("Sample test-method One. Thread id is: " + id); 21 | } 22 | 23 | @Test 24 | public void testMethodTwo() { 25 | long id = Thread.currentThread().getId(); 26 | System.out.println("Sample test-method Two. Thread id is: " + id); 27 | } 28 | 29 | @AfterClass 30 | public void afterClass() { 31 | long id = Thread.currentThread().getId(); 32 | System.out.println("After test-class. Thread id is: " + id); 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/java/com/github/functional/ParallelMethodTest.java: -------------------------------------------------------------------------------- 1 | package com.github.functional; 2 | 3 | import org.testng.annotations.AfterMethod; 4 | import org.testng.annotations.BeforeMethod; 5 | import org.testng.annotations.Test; 6 | 7 | public class ParallelMethodTest { 8 | 9 | // Credits of these test cases - https://howtodoinjava.com/testng/testng-executing-parallel-tests/ 10 | 11 | @BeforeMethod 12 | public void beforeMethod() { 13 | long id = Thread.currentThread().getId(); 14 | System.out.println("Before test-method. Thread id is: " + id); 15 | } 16 | 17 | @Test 18 | public void testMethodsOne() { 19 | long id = Thread.currentThread().getId(); 20 | System.out.println("Simple test-method One. Thread id is: " + id); 21 | } 22 | 23 | @Test 24 | public void testMethodsTwo() { 25 | long id = Thread.currentThread().getId(); 26 | System.out.println("Simple test-method Two. Thread id is: " + id); 27 | } 28 | 29 | @AfterMethod 30 | public void afterMethod() { 31 | long id = Thread.currentThread().getId(); 32 | System.out.println("After test-method. Thread id is: " + id); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/github/functional/ParallelSuiteTest.java: -------------------------------------------------------------------------------- 1 | package com.github.functional; 2 | 3 | import org.testng.annotations.AfterClass; 4 | import org.testng.annotations.AfterTest; 5 | import org.testng.annotations.BeforeClass; 6 | import org.testng.annotations.BeforeTest; 7 | import org.testng.annotations.Parameters; 8 | import org.testng.annotations.Test; 9 | 10 | public class ParallelSuiteTest { 11 | 12 | // Credits of these test cases - https://howtodoinjava.com/testng/testng-executing-parallel-tests/ 13 | 14 | String testName = ""; 15 | 16 | @BeforeTest 17 | @Parameters({ "test-name" }) 18 | public void beforeTest(String testName) { 19 | this.testName = testName; 20 | long id = Thread.currentThread().getId(); 21 | System.out.println("Before test " + testName + ". Thread id is: " + id); 22 | } 23 | 24 | @BeforeClass 25 | public void beforeClass() { 26 | long id = Thread.currentThread().getId(); 27 | System.out.println("Before test-class " + testName + ". Thread id is: " 28 | + id); 29 | } 30 | 31 | @Test 32 | public void testMethodOne() { 33 | long id = Thread.currentThread().getId(); 34 | System.out.println("Sample test-method " + testName 35 | + ". Thread id is: " + id); 36 | } 37 | 38 | @AfterClass 39 | public void afterClass() { 40 | long id = Thread.currentThread().getId(); 41 | System.out.println("After test-method " + testName 42 | + ". Thread id is: " + id); 43 | } 44 | 45 | @AfterTest 46 | public void afterTest() { 47 | long id = Thread.currentThread().getId(); 48 | System.out.println("After test " + testName + ". Thread id is: " + id); 49 | } 50 | } -------------------------------------------------------------------------------- /test-output/Suite/Test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestNG: Test 4 | 5 | 6 | 7 | 11 | 53 | 54 | 55 | 56 |

Test

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Tests passed/Failed/Skipped:2/2/1
Started on:Fri May 08 19:03:01 IST 2020
Total time:27 seconds (27061 ms)
Included groups:
Excluded groups:

69 | (Hover the method name to see the test class name)

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 117 | 118 | 119 | 120 | 121 | 159 | 160 | 161 |
FAILED TESTS
Test methodExceptionTime (seconds)Instance
dataProviderTest
Test class: com.github.functional.FunctionalSample
Parameters: testuser_2, Test@321
java.lang.AssertionError: expected [TestNGMetrics] but found [TestNG]
 80 | 	at com.github.functional.FunctionalSample.dataProviderTest(FunctionalSample.java:78)
 81 | ... Removed 32 stack frames
Click to show all stack frames 82 |
java.lang.AssertionError: expected [TestNGMetrics] but found [TestNG]
 83 | 	at org.testng.Assert.fail(Assert.java:97)
 84 | 	at org.testng.Assert.assertEqualsImpl(Assert.java:136)
 85 | 	at org.testng.Assert.assertEquals(Assert.java:118)
 86 | 	at org.testng.Assert.assertEquals(Assert.java:575)
 87 | 	at org.testng.Assert.assertEquals(Assert.java:585)
 88 | 	at com.github.functional.FunctionalSample.dataProviderTest(FunctionalSample.java:78)
 89 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 90 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 91 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 92 | 	at java.lang.reflect.Method.invoke(Method.java:498)
 93 | 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:131)
 94 | 	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:570)
 95 | 	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:170)
 96 | 	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
 97 | 	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:790)
 98 | 	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:143)
 99 | 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
100 | 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
101 | 	at org.testng.TestRunner.privateRun(TestRunner.java:763)
102 | 	at org.testng.TestRunner.run(TestRunner.java:594)
103 | 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:398)
104 | 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:392)
105 | 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355)
106 | 	at org.testng.SuiteRunner.run(SuiteRunner.java:304)
107 | 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
108 | 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
109 | 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1146)
110 | 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1067)
111 | 	at org.testng.TestNG.runSuites(TestNG.java:997)
112 | 	at org.testng.TestNG.run(TestNG.java:965)
113 | 	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
114 | 	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
115 | 	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
116 | 
5com.github.functional.FunctionalSample@5cb9f472
failingTest
Test class: com.github.functional.FunctionalSample
java.lang.AssertionError: expected [Metrics] but found [TestNG]
122 | 	at com.github.functional.FunctionalSample.failingTest(FunctionalSample.java:51)
123 | ... Removed 32 stack frames
Click to show all stack frames 124 |
java.lang.AssertionError: expected [Metrics] but found [TestNG]
125 | 	at org.testng.Assert.fail(Assert.java:97)
126 | 	at org.testng.Assert.assertEqualsImpl(Assert.java:136)
127 | 	at org.testng.Assert.assertEquals(Assert.java:118)
128 | 	at org.testng.Assert.assertEquals(Assert.java:575)
129 | 	at org.testng.Assert.assertEquals(Assert.java:585)
130 | 	at com.github.functional.FunctionalSample.failingTest(FunctionalSample.java:51)
131 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
132 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
133 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
134 | 	at java.lang.reflect.Method.invoke(Method.java:498)
135 | 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:131)
136 | 	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:570)
137 | 	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:170)
138 | 	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
139 | 	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:790)
140 | 	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:143)
141 | 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
142 | 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
143 | 	at org.testng.TestRunner.privateRun(TestRunner.java:763)
144 | 	at org.testng.TestRunner.run(TestRunner.java:594)
145 | 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:398)
146 | 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:392)
147 | 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355)
148 | 	at org.testng.SuiteRunner.run(SuiteRunner.java:304)
149 | 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
150 | 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
151 | 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1146)
152 | 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1067)
153 | 	at org.testng.TestNG.runSuites(TestNG.java:997)
154 | 	at org.testng.TestNG.run(TestNG.java:965)
155 | 	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
156 | 	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
157 | 	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
158 | 
2com.github.functional.FunctionalSample@5cb9f472

162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 |
PASSED TESTS
Test methodExceptionTime (seconds)Instance
dataProviderTest
Test class: com.github.functional.FunctionalSample
Parameters: testuser_1, Test@123
5com.github.functional.FunctionalSample@5cb9f472
passingTest
Test class: com.github.functional.FunctionalSample
5com.github.functional.FunctionalSample@5cb9f472

180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 211 | 212 | 213 |
SKIPPED TESTS
Test methodExceptionTime (seconds)Instance
skippingTest
Test class: com.github.functional.FunctionalSample
java.lang.Throwable: Method FunctionalSample.skippingTest()[pri:0, instance:com.github.functional.FunctionalSample@5cb9f472] depends on not successfully finished methods
190 | ... Removed 18 stack frames
Click to show all stack frames 191 |
java.lang.Throwable: Method FunctionalSample.skippingTest()[pri:0, instance:com.github.functional.FunctionalSample@5cb9f472] depends on not successfully finished methods
192 | 	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:97)
193 | 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
194 | 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
195 | 	at org.testng.TestRunner.privateRun(TestRunner.java:763)
196 | 	at org.testng.TestRunner.run(TestRunner.java:594)
197 | 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:398)
198 | 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:392)
199 | 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355)
200 | 	at org.testng.SuiteRunner.run(SuiteRunner.java:304)
201 | 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
202 | 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
203 | 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1146)
204 | 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1067)
205 | 	at org.testng.TestNG.runSuites(TestNG.java:997)
206 | 	at org.testng.TestNG.run(TestNG.java:965)
207 | 	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
208 | 	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
209 | 	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
210 | 
0com.github.functional.FunctionalSample@5cb9f472

214 | 215 | -------------------------------------------------------------------------------- /test-output/Suite/Test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test-output/Suite/testng-failed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test-output/Test-class Suite/Test-class test 1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestNG: Test-class test 1 4 | 5 | 6 | 7 | 11 | 53 | 54 | 55 | 56 |

Test-class test 1

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Tests passed/Failed/Skipped:1/0/0
Started on:Sat May 09 20:41:41 IST 2020
Total time:0 seconds (57 ms)
Included groups:
Excluded groups:

69 | (Hover the method name to see the test class name)

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
PASSED TESTS
Test methodExceptionTime (seconds)Instance
testMethodOne
Test class: com.github.functional.ParallelSuiteTest
0com.github.functional.ParallelSuiteTest@5cb9f472

83 | 84 | -------------------------------------------------------------------------------- /test-output/Test-class Suite/Test-class test 1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test-output/Test-class Suite/Test-class test 2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestNG: Test-class test 2 4 | 5 | 6 | 7 | 11 | 53 | 54 | 55 | 56 |

Test-class test 2

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Tests passed/Failed/Skipped:1/0/0
Started on:Sat May 09 20:41:41 IST 2020
Total time:0 seconds (57 ms)
Included groups:
Excluded groups:

69 | (Hover the method name to see the test class name)

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
PASSED TESTS
Test methodExceptionTime (seconds)Instance
testMethodOne
Test class: com.github.functional.ParallelSuiteTest
0com.github.functional.ParallelSuiteTest@4e1d422d

83 | 84 | -------------------------------------------------------------------------------- /test-output/Test-class Suite/Test-class test 2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test-output/Test-class Suite/Test-class test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestNG: Test-class test 4 | 5 | 6 | 7 | 11 | 53 | 54 | 55 | 56 |

Test-class test

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Tests passed/Failed/Skipped:4/0/0
Started on:Sat May 09 20:40:33 IST 2020
Total time:0 seconds (55 ms)
Included groups:
Excluded groups:

69 | (Hover the method name to see the test class name)

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
PASSED TESTS
Test methodExceptionTime (seconds)Instance
testMethodOne
Test class: com.github.functional.ParallelClassesTestOne
0com.github.functional.ParallelClassesTestOne@6e06451e
testMethodOne
Test class: com.github.functional.ParallelClassesTestTwo
0com.github.functional.ParallelClassesTestTwo@59494225
testMethodTwo
Test class: com.github.functional.ParallelClassesTestOne
0com.github.functional.ParallelClassesTestOne@6e06451e
testMethodTwo
Test class: com.github.functional.ParallelClassesTestTwo
0com.github.functional.ParallelClassesTestTwo@59494225

98 | 99 | -------------------------------------------------------------------------------- /test-output/Test-class Suite/Test-class test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test-output/Test-method Suite/Test-method test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestNG: Test-method test 4 | 5 | 6 | 7 | 11 | 53 | 54 | 55 | 56 |

Test-method test

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Tests passed/Failed/Skipped:2/0/0
Started on:Sat May 09 20:41:05 IST 2020
Total time:0 seconds (51 ms)
Included groups:
Excluded groups:

69 | (Hover the method name to see the test class name)

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
PASSED TESTS
Test methodExceptionTime (seconds)Instance
testMethodsOne
Test class: com.github.functional.ParallelMethodTest
0com.github.functional.ParallelMethodTest@72d818d1
testMethodsTwo
Test class: com.github.functional.ParallelMethodTest
0com.github.functional.ParallelMethodTest@72d818d1

88 | 89 | -------------------------------------------------------------------------------- /test-output/Test-method Suite/Test-method test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/bullet_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adiralashiva8/testng-metrics/52bd7c2820a2ee8454a21cb7c0247efb0a11b0e0/test-output/bullet_point.png -------------------------------------------------------------------------------- /test-output/collapseall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adiralashiva8/testng-metrics/52bd7c2820a2ee8454a21cb7c0247efb0a11b0e0/test-output/collapseall.gif -------------------------------------------------------------------------------- /test-output/emailable-report.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestNG Report 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Test# Passed# Skipped# Retried# FailedTime (ms)Included GroupsExcluded Groups
Test-class Suite
Test-class test 1100057
Test-class test 2100057
Total2000114
16 | 17 | 18 |
ClassMethodStartTime (ms)
Test-class Suite
Test-class test 1 — passed
com.github.functional.ParallelSuiteTesttestMethodOne15890371017195
Test-class test 2 — passed
com.github.functional.ParallelSuiteTesttestMethodOne15890371017196
19 |

Test-class test 1

com.github.functional.ParallelSuiteTest#testMethodOne

back to summary

20 |

Test-class test 2

com.github.functional.ParallelSuiteTest#testMethodOne

back to summary

21 | 22 | 23 | -------------------------------------------------------------------------------- /test-output/failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adiralashiva8/testng-metrics/52bd7c2820a2ee8454a21cb7c0247efb0a11b0e0/test-output/failed.png -------------------------------------------------------------------------------- /test-output/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TestNG reports 7 | 8 | 9 | 10 | 11 | 12 | 18 | 21 | 22 | 23 | 24 |
25 | Test results 26 |
27 | 1 suite 28 |
29 | 122 |
123 |
124 |
125 |
126 |
127 | 128 | com.github.functional.ParallelSuiteTest 129 |
130 |
131 |
132 |
133 | 134 | 135 | testMethodOne 136 |
137 |
138 |
139 |
140 | 141 | 142 | testMethodOne 143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | D:\WorkShop\Main\testng-metrics\testng_xml\suite-test-testng.xml 151 |
152 |
153 |
154 | <?xml version="1.0" encoding="UTF-8"?>
155 | <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
156 | <suite thread-count="2" name="Test-class Suite" parallel="tests">
157 |   <parameter name="testng.metrics.report.name" value="parallel_tests.html"/>
158 |   <parameter name="testng.metrics.report.logo" value="https://i.ibb.co/FqtQyC5/rfh.png"/>
159 |   <parameter name="testng.metrics.report.appendTimestamp" value="True"/>
160 |   <test thread-count="2" name="Test-class test 1" parallel="tests">
161 |     <parameter name="test-name" value="test-method One"/>
162 |     <classes>
163 |       <class name="com.github.functional.ParallelSuiteTest"/>
164 |     </classes>
165 |   </test> <!-- Test-class test 1 -->
166 |   <test thread-count="2" name="Test-class test 2" parallel="tests">
167 |     <parameter name="test-name" value="test-method One"/>
168 |     <classes>
169 |       <class name="com.github.functional.ParallelSuiteTest"/>
170 |     </classes>
171 |   </test> <!-- Test-class test 2 -->
172 | </suite> <!-- Test-class Suite -->
173 |             
174 |
175 |
176 |
177 |
178 | Tests for Test-class Suite 179 |
180 |
181 |
    182 |
  • 183 | Test-class test 1 (1 class) 184 |
  • 185 |
  • 186 | Test-class test 2 (1 class) 187 |
  • 188 |
189 |
190 |
191 |
192 |
193 | Groups for Test-class Suite 194 |
195 |
196 |
197 |
198 |
199 |
200 | Times for Test-class Suite 201 |
202 |
203 |
204 | 225 | Total running time: 57 ms 226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 | Reporter output for Test-class Suite 234 |
235 |
236 |
237 |
238 |
239 |
240 | 0 ignored methods 241 |
242 |
243 |
244 |
245 |
246 |
247 | Methods in chronological order 248 |
249 |
250 |
251 |
com.github.functional.ParallelSuiteTest
252 |
253 | beforeTest(test-method One) 254 | 0 ms 255 |
256 |
257 | beforeTest(test-method One) 258 | 0 ms 259 |
260 |
261 | beforeClass 262 | 25 ms 263 |
264 |
265 | beforeClass 266 | 25 ms 267 |
268 |
269 | testMethodOne 270 | 33 ms 271 |
272 |
273 | testMethodOne 274 | 33 ms 275 |
276 |
277 | afterClass 278 | 42 ms 279 |
280 |
281 | afterClass 282 | 42 ms 283 |
284 |
285 | afterTest 286 | 44 ms 287 |
288 |
289 | afterTest 290 | 44 ms 291 |
292 |
293 |
294 |
295 |
296 | 297 | 298 | -------------------------------------------------------------------------------- /test-output/junitreports/TEST-com.github.functional.ParallelClassesTestOne.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/junitreports/TEST-com.github.functional.ParallelClassesTestTwo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/junitreports/TEST-com.github.functional.ParallelMethodTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/junitreports/TEST-com.github.functional.ParallelSuiteTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/navigator-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adiralashiva8/testng-metrics/52bd7c2820a2ee8454a21cb7c0247efb0a11b0e0/test-output/navigator-bullet.png -------------------------------------------------------------------------------- /test-output/old/Suite/Test.properties: -------------------------------------------------------------------------------- 1 | [SuiteResult context=Test] -------------------------------------------------------------------------------- /test-output/old/Suite/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
Class nameMethod nameGroups
com.github.functional.FunctionalSample  
@Test
 failingTest 
 dataProviderTest 
 skippingTest 
 passingTest 
@BeforeClass
 beforeClass 
@BeforeMethod
@AfterMethod
@AfterClass
 afterClass 
49 | -------------------------------------------------------------------------------- /test-output/old/Suite/groups.html: -------------------------------------------------------------------------------- 1 |

Groups used for this test run

-------------------------------------------------------------------------------- /test-output/old/Suite/index.html: -------------------------------------------------------------------------------- 1 | Results for Suite 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/old/Suite/main.html: -------------------------------------------------------------------------------- 1 | Results for Suite 2 | Select a result on the left-hand pane. 3 | -------------------------------------------------------------------------------- /test-output/old/Suite/methods-alphabetical.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Suite

(Hover the method name to see the test class name)

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
20/05/08 19:03:23 0   <<afterClass    main@2097514481
20/05/08 19:03:01 -22032   >>beforeClass    main@2097514481
20/05/08 19:03:13 -10009      dataProviderTestmain@2097514481
20/05/08 19:03:18 -5008      dataProviderTestmain@2097514481
20/05/08 19:03:06 -17024      failingTestmain@2097514481
20/05/08 19:03:08 -15014      passingTestmain@2097514481
20/05/08 19:03:23 -1      skippingTest
19 | -------------------------------------------------------------------------------- /test-output/old/Suite/methods-not-run.html: -------------------------------------------------------------------------------- 1 |

Methods that were not run

2 |
-------------------------------------------------------------------------------- /test-output/old/Suite/methods.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Suite

(Hover the method name to see the test class name)

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
20/05/08 19:03:01 0   >>beforeClass    main@2097514481
20/05/08 19:03:06 5008      failingTestmain@2097514481
20/05/08 19:03:08 7018      passingTestmain@2097514481
20/05/08 19:03:13 12023      dataProviderTestmain@2097514481
20/05/08 19:03:18 17024      dataProviderTestmain@2097514481
20/05/08 19:03:23 22031      skippingTest
20/05/08 19:03:23 22032   <<afterClass    main@2097514481
19 | -------------------------------------------------------------------------------- /test-output/old/Suite/reporter-output.html: -------------------------------------------------------------------------------- 1 |

Reporter output

-------------------------------------------------------------------------------- /test-output/old/Suite/testng.xml.html: -------------------------------------------------------------------------------- 1 | testng.xml for Suite<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite guice-stage="DEVELOPMENT" name="Suite">
  <parameter name="testng.metrics.report.name" value="regression.html"/>
  <parameter name="testng.metrics.report.logo" value="https://i.ibb.co/FqtQyC5/rfh.png"/>
  <parameter name="testng.metrics.report.appendTimestamp" value="True"/>
  <test thread-count="5" name="Test">
    <parameter name="sUsername" value="testuser_1"/>
    <parameter name="sPassword" value="Test@123"/>
    <classes>
      <class name="com.github.functional.FunctionalSample"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->
-------------------------------------------------------------------------------- /test-output/old/Suite/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Results for Suite 4 | 5 | 6 | 7 | 8 |

Results for
Suite

9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 |
1 test1 class4 methods:
14 |   chronological
15 |   alphabetical
16 |   not run (0)
0 groupreporter outputtestng.xml
23 | 24 |

29 |

25 |
Test (2/2/1) 26 | Results 27 |
28 |
30 | -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/Test-class test 1.properties: -------------------------------------------------------------------------------- 1 | [SuiteResult context=Test-class test 1][SuiteResult context=Test-class test 2] -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/Test-class test 2.properties: -------------------------------------------------------------------------------- 1 | [SuiteResult context=Test-class test 1][SuiteResult context=Test-class test 2] -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/Test-class test.properties: -------------------------------------------------------------------------------- 1 | [SuiteResult context=Test-class test] -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
Class nameMethod nameGroups
com.github.functional.ParallelSuiteTest  
@Test
 testMethodOne 
@BeforeClass
 beforeClass 
@BeforeMethod
@AfterMethod
@AfterClass
 afterClass 
37 | -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/groups.html: -------------------------------------------------------------------------------- 1 |

Groups used for this test run

-------------------------------------------------------------------------------- /test-output/old/Test-class Suite/index.html: -------------------------------------------------------------------------------- 1 | Results for Test-class Suite 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/main.html: -------------------------------------------------------------------------------- 1 | Results for Test-class Suite 2 | Select a result on the left-hand pane. 3 | -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/methods-alphabetical.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Test-class Suite

(Hover the method name to see the test class name)

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
20/05/09 20:41:41 0   <<afterClass    TestNG-tests-1@1192577751
20/05/09 20:41:41 0   <<afterClass    TestNG-tests-2@1374880493
20/05/09 20:41:41 2  <<afterTest     TestNG-tests-2@1374880493
20/05/09 20:41:41 2  <<afterTest     TestNG-tests-1@1192577751
20/05/09 20:41:41 -17   >>beforeClass    TestNG-tests-2@1374880493
20/05/09 20:41:41 -17   >>beforeClass    TestNG-tests-1@1192577751
20/05/09 20:41:41 -30  >>beforeTest     TestNG-tests-2@1374880493
20/05/09 20:41:41 -30  >>beforeTest     TestNG-tests-1@1192577751
20/05/09 20:41:41 -9      testMethodOneTestNG-tests-1@1192577751
20/05/09 20:41:41 -9      testMethodOneTestNG-tests-2@1374880493
25 | -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/methods-not-run.html: -------------------------------------------------------------------------------- 1 |

Methods that were not run

2 |
-------------------------------------------------------------------------------- /test-output/old/Test-class Suite/methods.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Test-class Suite

(Hover the method name to see the test class name)

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
20/05/09 20:41:41 0  >>beforeTest     TestNG-tests-2@1374880493
20/05/09 20:41:41 0  >>beforeTest     TestNG-tests-1@1192577751
20/05/09 20:41:41 13   >>beforeClass    TestNG-tests-2@1374880493
20/05/09 20:41:41 13   >>beforeClass    TestNG-tests-1@1192577751
20/05/09 20:41:41 21      testMethodOneTestNG-tests-1@1192577751
20/05/09 20:41:41 21      testMethodOneTestNG-tests-2@1374880493
20/05/09 20:41:41 30   <<afterClass    TestNG-tests-1@1192577751
20/05/09 20:41:41 30   <<afterClass    TestNG-tests-2@1374880493
20/05/09 20:41:41 32  <<afterTest     TestNG-tests-2@1374880493
20/05/09 20:41:41 32  <<afterTest     TestNG-tests-1@1192577751
25 | -------------------------------------------------------------------------------- /test-output/old/Test-class Suite/reporter-output.html: -------------------------------------------------------------------------------- 1 |

Reporter output

-------------------------------------------------------------------------------- /test-output/old/Test-class Suite/testng.xml.html: -------------------------------------------------------------------------------- 1 | testng.xml for Test-class Suite<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="2" name="Test-class Suite" parallel="tests">
  <parameter name="testng.metrics.report.name" value="parallel_tests.html"/>
  <parameter name="testng.metrics.report.logo" value="https://i.ibb.co/FqtQyC5/rfh.png"/>
  <parameter name="testng.metrics.report.appendTimestamp" value="True"/>
  <test thread-count="2" name="Test-class test 1" parallel="tests">
    <parameter name="test-name" value="test-method One"/>
    <classes>
      <class name="com.github.functional.ParallelSuiteTest"/>
    </classes>
  </test> <!-- Test-class test 1 -->
  <test thread-count="2" name="Test-class test 2" parallel="tests">
    <parameter name="test-name" value="test-method One"/>
    <classes>
      <class name="com.github.functional.ParallelSuiteTest"/>
    </classes>
  </test> <!-- Test-class test 2 -->
</suite> <!-- Test-class Suite -->
-------------------------------------------------------------------------------- /test-output/old/Test-class Suite/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Results for Test-class Suite 4 | 5 | 6 | 7 | 8 |

Results for
Test-class Suite

9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 |
2 tests1 class2 methods:
14 |   chronological
15 |   alphabetical
16 |   not run (0)
0 groupreporter outputtestng.xml
23 | 24 |

29 |

25 |
Test-class test 1 (1/0/0) 26 | Results 27 |
28 |
30 | 31 | 32 |

37 |

33 |
Test-class test 2 (1/0/0) 34 | Results 35 |
36 |
38 | -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/Test-method test.properties: -------------------------------------------------------------------------------- 1 | [SuiteResult context=Test-method test] -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
Class nameMethod nameGroups
com.github.functional.ParallelMethodTest  
@Test
 testMethodsOne 
 testMethodsTwo 
@BeforeClass
@BeforeMethod
 beforeMethod 
@AfterMethod
 afterMethod 
@AfterClass
41 | -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/groups.html: -------------------------------------------------------------------------------- 1 |

Groups used for this test run

-------------------------------------------------------------------------------- /test-output/old/Test-method Suite/index.html: -------------------------------------------------------------------------------- 1 | Results for Test-method Suite 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/main.html: -------------------------------------------------------------------------------- 1 | Results for Test-method Suite 2 | Select a result on the left-hand pane. 3 | -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/methods-alphabetical.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Test-method Suite

(Hover the method name to see the test class name)

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
20/05/09 20:41:05 0     <<afterMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 1     <<afterMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 -11     >>beforeMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 -11     >>beforeMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 -7      testMethodsOneTestNG-test=Test-method test-1@1797542481
20/05/09 20:41:05 -7      testMethodsTwoTestNG-test=Test-method test-2@1198613894
17 | -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/methods-not-run.html: -------------------------------------------------------------------------------- 1 |

Methods that were not run

2 |
-------------------------------------------------------------------------------- /test-output/old/Test-method Suite/methods.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Test-method Suite

(Hover the method name to see the test class name)

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
20/05/09 20:41:05 0     >>beforeMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 0     >>beforeMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 4      testMethodsTwoTestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 4      testMethodsOneTestNG-test=Test-method test-1@1797542481
20/05/09 20:41:05 11     <<afterMethod  TestNG-test=Test-method test-2@1198613894
20/05/09 20:41:05 12     <<afterMethod  TestNG-test=Test-method test-2@1198613894
17 | -------------------------------------------------------------------------------- /test-output/old/Test-method Suite/reporter-output.html: -------------------------------------------------------------------------------- 1 |

Reporter output

-------------------------------------------------------------------------------- /test-output/old/Test-method Suite/testng.xml.html: -------------------------------------------------------------------------------- 1 | testng.xml for Test-method Suite<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="2" name="Test-method Suite" parallel="methods">
  <parameter name="testng.metrics.report.name" value="parallel_methods.html"/>
  <parameter name="testng.metrics.report.logo" value="https://i.ibb.co/FqtQyC5/rfh.png"/>
  <parameter name="testng.metrics.report.appendTimestamp" value="True"/>
  <test thread-count="2" name="Test-method test" parallel="methods" group-by-instances="true">
    <classes>
      <class name="com.github.functional.ParallelMethodTest"/>
    </classes>
  </test> <!-- Test-method test -->
</suite> <!-- Test-method Suite -->
-------------------------------------------------------------------------------- /test-output/old/Test-method Suite/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Results for Test-method Suite 4 | 5 | 6 | 7 | 8 |

Results for
Test-method Suite

9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 |
1 test1 class2 methods:
14 |   chronological
15 |   alphabetical
16 |   not run (0)
0 groupreporter outputtestng.xml
23 | 24 |

29 |

25 |
Test-method test (2/0/0) 26 | Results 27 |
28 |
30 | -------------------------------------------------------------------------------- /test-output/old/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Test results

6 | 7 | 8 | 9 |
SuitePassedFailedSkippedtestng.xml
Total200 
Test-class Suite200Link
10 | -------------------------------------------------------------------------------- /test-output/parallel_classes_09_May_20_08_40_33.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestNG Metrics Report 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 40 | 41 | 42 | 43 |
44 | 45 | 53 | 54 |
55 |
56 |
57 |
Dashboard
58 |
59 |
60 |
61 | 62 | 63 | 64 | 82 | 83 | 84 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 78 | 79 | 80 |
44
73 | Total 74 | 76 | Pass 77 |
81 |
85 |
86 |
87 | 88 | 89 | 90 | 108 | 109 | 110 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 104 | 105 | 106 |
00
99 | Fail 100 | 102 | Skip 103 |
107 |
111 |
112 |
113 |
114 |
115 |
116 | Test Status: 117 |
118 |
119 |
120 | Top 5 Class Failures: 121 |
122 |
123 |
124 |
125 |
126 |
127 | Top 10 Test Performance(sec): 128 |
129 |
130 |
131 |
132 |
133 |
134 | Top 10 Config Methods Performance(sec): 135 |
136 |
137 |
138 | 139 |
140 |
141 |

142 | testng-metrics 143 |

144 |
145 |
146 | 147 | 159 |
160 |
161 |

Class Metrics

162 |
163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
Class NameTotalPassedFailedSkippedPass (%)
ParallelClassesTestOne2200100.0
ParallelClassesTestTwo2200100.0
193 |
194 |
195 |
196 |
197 |
198 |

Test Metrics

199 |
Total Execution Time: 00:00:00
200 |
201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Class NameTest NameStatusTime(s)Error Message
ParallelClassesTestTwotestMethodOnePASS0
ParallelClassesTestOnetestMethodTwoPASS0
ParallelClassesTestTwotestMethodTwoPASS0
ParallelClassesTestOnetestMethodOnePASS0
239 |
240 |
241 |
242 |
243 |
244 |

Method Metrics

245 |
246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 |
Class NameMethod NameStatusTime(s)Error Message
ParallelClassesTestOneafterClassPASS0
ParallelClassesTestOnebeforeClassPASS0
ParallelClassesTestTwoafterClassPASS0
ParallelClassesTestOnebeforeClassPASS0
ParallelClassesTestTwobeforeClassPASS0
289 |
290 |
291 |
292 |
293 |

**index.html need to be in current folder in order to display here

294 |
313 | 335 | 376 | 377 | 462 | 463 | 464 | 482 | 486 | 489 | 490 |
491 | 492 | -------------------------------------------------------------------------------- /test-output/parallel_methods_09_May_20_08_41_05.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestNG Metrics Report 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 40 | 41 | 42 | 43 |
44 | 45 | 53 | 54 |
55 |
56 |
57 |
Dashboard
58 |
59 |
60 |
61 | 62 | 63 | 64 | 82 | 83 | 84 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 78 | 79 | 80 |
22
73 | Total 74 | 76 | Pass 77 |
81 |
85 |
86 |
87 | 88 | 89 | 90 | 108 | 109 | 110 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 104 | 105 | 106 |
00
99 | Fail 100 | 102 | Skip 103 |
107 |
111 |
112 |
113 |
114 |
115 |
116 | Test Status: 117 |
118 |
119 |
120 | Top 5 Class Failures: 121 |
122 |
123 |
124 |
125 |
126 |
127 | Top 10 Test Performance(sec): 128 |
129 |
130 |
131 |
132 |
133 |
134 | Top 10 Config Methods Performance(sec): 135 |
136 |
137 |
138 | 139 |
140 |
141 |

142 | testng-metrics 143 |

144 |
145 |
146 | 147 | 159 |
160 |
161 |

Class Metrics

162 |
163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 |
Class NameTotalPassedFailedSkippedPass (%)
ParallelMethodTest2200100.0
185 |
186 |
187 |
188 |
189 |
190 |

Test Metrics

191 |
Total Execution Time: 00:00:00
192 |
193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 |
Class NameTest NameStatusTime(s)Error Message
ParallelMethodTesttestMethodsTwoPASS0
ParallelMethodTesttestMethodsOnePASS0
219 |
220 |
221 |
222 |
223 |
224 |

Method Metrics

225 |
226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 |
Class NameMethod NameStatusTime(s)Error Message
ParallelMethodTestbeforeMethodPASS0
ParallelMethodTestafterMethodPASS0
ParallelMethodTestbeforeMethodPASS0
ParallelMethodTestafterMethodPASS0
263 |
264 |
265 |
266 |
267 |

**index.html need to be in current folder in order to display here

268 |
287 | 309 | 350 | 351 | 436 | 437 | 438 | 456 | 460 | 463 | 464 |
465 | 466 | -------------------------------------------------------------------------------- /test-output/parallel_tests_09_May_20_08_41_41.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestNG Metrics Report 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 40 | 41 | 42 | 43 |
44 | 45 | 53 | 54 |
55 |
56 |
57 |
Dashboard
58 |
59 |
60 |
61 | 62 | 63 | 64 | 82 | 83 | 84 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 78 | 79 | 80 |
22
73 | Total 74 | 76 | Pass 77 |
81 |
85 |
86 |
87 | 88 | 89 | 90 | 108 | 109 | 110 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 104 | 105 | 106 |
00
99 | Fail 100 | 102 | Skip 103 |
107 |
111 |
112 |
113 |
114 |
115 |
116 | Test Status: 117 |
118 |
119 |
120 | Top 5 Class Failures: 121 |
122 |
123 |
124 |
125 |
126 |
127 | Top 10 Test Performance(sec): 128 |
129 |
130 |
131 |
132 |
133 |
134 | Top 10 Config Methods Performance(sec): 135 |
136 |
137 |
138 | 139 |
140 |
141 |

142 | testng-metrics 143 |

144 |
145 |
146 | 147 | 159 |
160 |
161 |

Class Metrics

162 |
163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
Class NameTotalPassedFailedSkippedPass (%)
ParallelSuiteTest1100100.0
ParallelSuiteTest1100100.0
193 |
194 |
195 |
196 |
197 |
198 |

Test Metrics

199 |
Total Execution Time: 00:00:00
200 |
201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 |
Class NameTest NameStatusTime(s)Error Message
ParallelSuiteTesttestMethodOnePASS0
ParallelSuiteTesttestMethodOnePASS0
227 |
228 |
229 |
230 |
231 |
232 |

Method Metrics

233 |
234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 |
Class NameMethod NameStatusTime(s)Error Message
ParallelSuiteTestbeforeClassPASS0
ParallelSuiteTestafterClassPASS0
ParallelSuiteTestafterTestPASS0
ParallelSuiteTestbeforeTest ([test-method One])PASS0
ParallelSuiteTestbeforeTest ([test-method One])PASS0
ParallelSuiteTestbeforeClassPASS0
ParallelSuiteTestafterTestPASS0
ParallelSuiteTestafterClassPASS0
295 |
296 |
297 |
298 |
299 |

**index.html need to be in current folder in order to display here

300 |
319 | 341 | 382 | 383 | 468 | 469 | 470 | 488 | 492 | 495 | 496 |
497 | 498 | -------------------------------------------------------------------------------- /test-output/passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adiralashiva8/testng-metrics/52bd7c2820a2ee8454a21cb7c0247efb0a11b0e0/test-output/passed.png -------------------------------------------------------------------------------- /test-output/skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adiralashiva8/testng-metrics/52bd7c2820a2ee8454a21cb7c0247efb0a11b0e0/test-output/skipped.png -------------------------------------------------------------------------------- /test-output/testng-failed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test-output/testng-reports.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0 0 5px 5px; 3 | } 4 | 5 | ul { 6 | margin: 0; 7 | } 8 | 9 | li { 10 | list-style-type: none; 11 | } 12 | 13 | a { 14 | text-decoration: none; 15 | } 16 | 17 | a:hover { 18 | text-decoration: underline; 19 | } 20 | 21 | .navigator-selected { 22 | background: #ffa500; 23 | } 24 | 25 | .wrapper { 26 | position: absolute; 27 | top: 60px; 28 | bottom: 0; 29 | left: 400px; 30 | right: 0; 31 | overflow: auto; 32 | } 33 | 34 | .navigator-root { 35 | position: absolute; 36 | top: 60px; 37 | bottom: 0; 38 | left: 0; 39 | width: 400px; 40 | overflow-y: auto; 41 | } 42 | 43 | .suite { 44 | margin: 0 10px 10px 0; 45 | background-color: #fff8dc; 46 | } 47 | 48 | .suite-name { 49 | padding-left: 10px; 50 | font-size: 25px; 51 | font-family: Times, sans-serif; 52 | } 53 | 54 | .main-panel-header { 55 | padding: 5px; 56 | background-color: #9FB4D9; /*afeeee*/; 57 | font-family: monospace; 58 | font-size: 18px; 59 | } 60 | 61 | .main-panel-content { 62 | padding: 5px; 63 | margin-bottom: 10px; 64 | background-color: #DEE8FC; /*d0ffff*/; 65 | } 66 | 67 | .rounded-window { 68 | border-radius: 10px; 69 | border-style: solid; 70 | border-width: 1px; 71 | } 72 | 73 | .rounded-window-top { 74 | border-top-right-radius: 10px 10px; 75 | border-top-left-radius: 10px 10px; 76 | border-style: solid; 77 | border-width: 1px; 78 | overflow: auto; 79 | } 80 | 81 | .light-rounded-window-top { 82 | border-top-right-radius: 10px 10px; 83 | border-top-left-radius: 10px 10px; 84 | } 85 | 86 | .rounded-window-bottom { 87 | border-style: solid; 88 | border-width: 0 1px 1px 1px; 89 | border-bottom-right-radius: 10px 10px; 90 | border-bottom-left-radius: 10px 10px; 91 | overflow: auto; 92 | } 93 | 94 | .method-name { 95 | font-size: 12px; 96 | font-family: monospace; 97 | } 98 | 99 | .method-content { 100 | border-style: solid; 101 | border-width: 0 0 1px 0; 102 | margin-bottom: 10px; 103 | padding-bottom: 5px; 104 | width: 80%; 105 | } 106 | 107 | .parameters { 108 | font-size: 14px; 109 | font-family: monospace; 110 | } 111 | 112 | .stack-trace { 113 | white-space: pre; 114 | font-family: monospace; 115 | font-size: 12px; 116 | font-weight: bold; 117 | margin-top: 0; 118 | margin-left: 20px; 119 | } 120 | 121 | .testng-xml { 122 | font-family: monospace; 123 | } 124 | 125 | .method-list-content { 126 | margin-left: 10px; 127 | } 128 | 129 | .navigator-suite-content { 130 | margin-left: 10px; 131 | font: 12px 'Lucida Grande'; 132 | } 133 | 134 | .suite-section-title { 135 | margin-top: 10px; 136 | width: 80%; 137 | border-style: solid; 138 | border-width: 1px 0 0 0; 139 | font-family: Times, sans-serif; 140 | font-size: 18px; 141 | font-weight: bold; 142 | } 143 | 144 | .suite-section-content { 145 | list-style-image: url(bullet_point.png); 146 | } 147 | 148 | .top-banner-root { 149 | position: absolute; 150 | top: 0; 151 | height: 45px; 152 | left: 0; 153 | right: 0; 154 | padding: 5px; 155 | margin: 0 0 5px 0; 156 | background-color: #0066ff; 157 | font-family: Times, sans-serif; 158 | color: #fff; 159 | text-align: center; 160 | } 161 | 162 | .top-banner-title-font { 163 | font-size: 25px; 164 | } 165 | 166 | .test-name { 167 | font-family: 'Lucida Grande', sans-serif; 168 | font-size: 16px; 169 | } 170 | 171 | .suite-icon { 172 | padding: 5px; 173 | float: right; 174 | height: 20px; 175 | } 176 | 177 | .test-group { 178 | font: 20px 'Lucida Grande'; 179 | margin: 5px 5px 10px 5px; 180 | border-width: 0 0 1px 0; 181 | border-style: solid; 182 | padding: 5px; 183 | } 184 | 185 | .test-group-name { 186 | font-weight: bold; 187 | } 188 | 189 | .method-in-group { 190 | font-size: 16px; 191 | margin-left: 80px; 192 | } 193 | 194 | table.google-visualization-table-table { 195 | width: 100%; 196 | } 197 | 198 | .reporter-method-name { 199 | font-size: 14px; 200 | font-family: monospace; 201 | } 202 | 203 | .reporter-method-output-div { 204 | padding: 5px; 205 | margin: 0 0 5px 20px; 206 | font-size: 12px; 207 | font-family: monospace; 208 | border-width: 0 0 0 1px; 209 | border-style: solid; 210 | } 211 | 212 | .ignored-class-div { 213 | font-size: 14px; 214 | font-family: monospace; 215 | } 216 | 217 | .ignored-methods-div { 218 | padding: 5px; 219 | margin: 0 0 5px 20px; 220 | font-size: 12px; 221 | font-family: monospace; 222 | border-width: 0 0 0 1px; 223 | border-style: solid; 224 | } 225 | 226 | .border-failed { 227 | border-top-left-radius: 10px 10px; 228 | border-bottom-left-radius: 10px 10px; 229 | border-style: solid; 230 | border-width: 0 0 0 10px; 231 | border-color: #f00; 232 | } 233 | 234 | .border-skipped { 235 | border-top-left-radius: 10px 10px; 236 | border-bottom-left-radius: 10px 10px; 237 | border-style: solid; 238 | border-width: 0 0 0 10px; 239 | border-color: #edc600; 240 | } 241 | 242 | .border-passed { 243 | border-top-left-radius: 10px 10px; 244 | border-bottom-left-radius: 10px 10px; 245 | border-style: solid; 246 | border-width: 0 0 0 10px; 247 | border-color: #19f52d; 248 | } 249 | 250 | .times-div { 251 | text-align: center; 252 | padding: 5px; 253 | } 254 | 255 | .suite-total-time { 256 | font: 16px 'Lucida Grande'; 257 | } 258 | 259 | .configuration-suite { 260 | margin-left: 20px; 261 | } 262 | 263 | .configuration-test { 264 | margin-left: 40px; 265 | } 266 | 267 | .configuration-class { 268 | margin-left: 60px; 269 | } 270 | 271 | .configuration-method { 272 | margin-left: 80px; 273 | } 274 | 275 | .test-method { 276 | margin-left: 100px; 277 | } 278 | 279 | .chronological-class { 280 | background-color: skyblue; 281 | border-style: solid; 282 | border-width: 0 0 1px 1px; 283 | } 284 | 285 | .method-start { 286 | float: right; 287 | } 288 | 289 | .chronological-class-name { 290 | padding: 0 0 0 5px; 291 | color: #008; 292 | } 293 | 294 | .after, .before, .test-method { 295 | font-family: monospace; 296 | font-size: 14px; 297 | } 298 | 299 | .navigator-suite-header { 300 | font-size: 22px; 301 | margin: 0 10px 5px 0; 302 | background-color: #deb887; 303 | text-align: center; 304 | } 305 | 306 | .collapse-all-icon { 307 | padding: 5px; 308 | float: right; 309 | } 310 | -------------------------------------------------------------------------------- /test-output/testng-reports.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('a.navigator-link').click(function() { 3 | // Extract the panel for this link 4 | var panel = getPanelName($(this)); 5 | 6 | // Mark this link as currently selected 7 | $('.navigator-link').parent().removeClass('navigator-selected'); 8 | $(this).parent().addClass('navigator-selected'); 9 | 10 | showPanel(panel); 11 | }); 12 | 13 | installMethodHandlers('failed'); 14 | installMethodHandlers('skipped'); 15 | installMethodHandlers('passed', true); // hide passed methods by default 16 | 17 | $('a.method').click(function() { 18 | showMethod($(this)); 19 | return false; 20 | }); 21 | 22 | // Hide all the panels and display the first one (do this last 23 | // to make sure the click() will invoke the listeners) 24 | $('.panel').hide(); 25 | $('.navigator-link').first().click(); 26 | 27 | // Collapse/expand the suites 28 | $('a.collapse-all-link').click(function() { 29 | var contents = $('.navigator-suite-content'); 30 | if (contents.css('display') == 'none') { 31 | contents.show(); 32 | } else { 33 | contents.hide(); 34 | } 35 | }); 36 | }); 37 | 38 | // The handlers that take care of showing/hiding the methods 39 | function installMethodHandlers(name, hide) { 40 | function getContent(t) { 41 | return $('.method-list-content.' + name + "." + t.attr('panel-name')); 42 | } 43 | 44 | function getHideLink(t, name) { 45 | var s = 'a.hide-methods.' + name + "." + t.attr('panel-name'); 46 | return $(s); 47 | } 48 | 49 | function getShowLink(t, name) { 50 | return $('a.show-methods.' + name + "." + t.attr('panel-name')); 51 | } 52 | 53 | function getMethodPanelClassSel(element, name) { 54 | var panelName = getPanelName(element); 55 | var sel = '.' + panelName + "-class-" + name; 56 | return $(sel); 57 | } 58 | 59 | $('a.hide-methods.' + name).click(function() { 60 | var w = getContent($(this)); 61 | w.hide(); 62 | getHideLink($(this), name).hide(); 63 | getShowLink($(this), name).show(); 64 | getMethodPanelClassSel($(this), name).hide(); 65 | }); 66 | 67 | $('a.show-methods.' + name).click(function() { 68 | var w = getContent($(this)); 69 | w.show(); 70 | getHideLink($(this), name).show(); 71 | getShowLink($(this), name).hide(); 72 | showPanel(getPanelName($(this))); 73 | getMethodPanelClassSel($(this), name).show(); 74 | }); 75 | 76 | if (hide) { 77 | $('a.hide-methods.' + name).click(); 78 | } else { 79 | $('a.show-methods.' + name).click(); 80 | } 81 | } 82 | 83 | function getHashForMethod(element) { 84 | return element.attr('hash-for-method'); 85 | } 86 | 87 | function getPanelName(element) { 88 | return element.attr('panel-name'); 89 | } 90 | 91 | function showPanel(panelName) { 92 | $('.panel').hide(); 93 | var panel = $('.panel[panel-name="' + panelName + '"]'); 94 | panel.show(); 95 | } 96 | 97 | function showMethod(element) { 98 | var hashTag = getHashForMethod(element); 99 | var panelName = getPanelName(element); 100 | showPanel(panelName); 101 | var current = document.location.href; 102 | var base = current.substring(0, current.indexOf('#')) 103 | document.location.href = base + '#' + hashTag; 104 | var newPosition = $(document).scrollTop() - 65; 105 | $(document).scrollTop(newPosition); 106 | } 107 | 108 | function drawTable() { 109 | for (var i = 0; i < suiteTableInitFunctions.length; i++) { 110 | window[suiteTableInitFunctions[i]](); 111 | } 112 | 113 | for (var k in window.suiteTableData) { 114 | var v = window.suiteTableData[k]; 115 | var div = v.tableDiv; 116 | var data = v.tableData 117 | var table = new google.visualization.Table(document.getElementById(div)); 118 | table.draw(data, { 119 | showRowNumber : false 120 | }); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /test-output/testng-results.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /test-output/testng.css: -------------------------------------------------------------------------------- 1 | .invocation-failed, .test-failed { background-color: #DD0000; } 2 | .invocation-percent, .test-percent { background-color: #006600; } 3 | .invocation-passed, .test-passed { background-color: #00AA00; } 4 | .invocation-skipped, .test-skipped { background-color: #CCCC00; } 5 | 6 | .main-page { 7 | font-size: x-large; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /test-output/testng_metrics.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestNG Metrics Report 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 40 | 41 | 42 | 43 |
44 | 45 | 53 | 54 |
55 |
56 |
57 |
Dashboard
58 |
59 |
60 |
61 | 62 | 63 | 64 | 82 | 83 | 84 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 78 | 79 | 80 |
22
73 | Total 74 | 76 | Pass 77 |
81 |
85 |
86 |
87 | 88 | 89 | 90 | 108 | 109 | 110 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 104 | 105 | 106 |
00
99 | Fail 100 | 102 | Skip 103 |
107 |
111 |
112 |
113 |
114 |
115 |
116 | Test Status: 117 |
118 |
119 |
120 | Top 5 Class Failures: 121 |
122 |
123 |
124 |
125 |
126 |
127 | Top 10 Test Performance(sec): 128 |
129 |
130 |
131 |
132 |
133 |
134 | Top 10 Config Methods Performance(sec): 135 |
136 |
137 |
138 | 139 |
140 |
141 |

142 | testng-metrics 143 |

144 |
145 |
146 | 147 | 159 |
160 |
161 |

Class Metrics

162 |
163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
Class NameTotalPassedFailedSkippedPass (%)
ParallelSuiteTest1100100.0
ParallelSuiteTest1100100.0
193 |
194 |
195 |
196 |
197 |
198 |

Test Metrics

199 |
Total Execution Time: 00:00:00
200 |
201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 |
Class NameTest NameStatusTime(s)Error Message
ParallelSuiteTesttestMethodOnePASS0
ParallelSuiteTesttestMethodOnePASS0
227 |
228 |
229 |
230 |
231 |
232 |

Method Metrics

233 |
234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 |
Class NameMethod NameStatusTime(s)Error Message
ParallelSuiteTestbeforeTest ([test-method One])PASS0
ParallelSuiteTestafterClassPASS0
ParallelSuiteTestbeforeClassPASS0
ParallelSuiteTestafterTestPASS0
ParallelSuiteTestafterClassPASS0
ParallelSuiteTestbeforeTest ([test-method One])PASS0
ParallelSuiteTestbeforeClassPASS0
ParallelSuiteTestafterTestPASS0
295 |
296 |
297 |
298 |
299 |

**index.html need to be in current folder in order to display here

300 |
319 | 341 | 382 | 383 | 468 | 469 | 470 | 488 | 492 | 495 | 496 |
497 | 498 | -------------------------------------------------------------------------------- /testng_xml/classes-test-testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /testng_xml/methods-test-testng.xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /testng_xml/suite-test-testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /testng_xml/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | --------------------------------------------------------------------------------