别人写的 testNG 的一个插件,只要配置一下监听,就可以实时查看测试运行的汇总情况和详细情况,感觉跟平台类的 dashboard 配合在一起(链接潜入)很好玩

package com.fudax.report.realtime.filehandler;

public class FileNameConstants {
    /*
     * Folder name constants
     */
    public static final String ROOT_FOLDER = System.getProperty("realtimeReportDir");
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.20.1</version>
        <configuration>
            <suiteXmlFiles>
                <file>task/testng.xml</file>
            </suiteXmlFiles>
            <properties>
                <property>
                    <name>usedefaultlisteners</name>
                    <value>false</value>
                </property>
                <property>
                    <name>listener</name>
                    <value>com.fudax.report.HTMLReporter,
                        org.testng.reporters.FailedReporter,com.fudax.report.realtime.listener.RealTimeTestResultListener</value>
                </property>
            </properties>
            <reportsDirectory>${basedir}/report</reportsDirectory>
            <systemProperties>
                <property>
                    <name>realtimeReportDir</name>
                    <value>${basedir}/report/realtime</value>
                </property>
            </systemProperties>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.apache.maven.surefire</groupId>
                <artifactId>surefire-testng</artifactId>
                <version>2.20.1</version>
            </dependency>
        </dependencies>
    </plugin>
    [...]
</plugins>


↙↙↙阅读原文可查看相关链接,并与作者交流