Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Surefire报告没有';不显示测试结果_Java_Maven_Testng_Surefire - Fatal编程技术网

Java Surefire报告没有';不显示测试结果

Java Surefire报告没有';不显示测试结果,java,maven,testng,surefire,Java,Maven,Testng,Surefire,我已经用maven配置了surefire报告 我没有得到任何错误,但我也没有得到执行测试的结果 当作为Maven测试运行时。我已经附上了截图。我也有适当的Maven项目结构 以下日志在作为Maven测试运行时显示 [INFO] Scanning for projects...[![enter image description here][1]][1] [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.bui

我已经用maven配置了surefire报告

我没有得到任何错误,但我也没有得到执行测试的结果 当作为Maven测试运行时。我已经附上了截图。我也有适当的Maven项目结构

以下日志在作为Maven测试运行时显示

[INFO] Scanning for projects...[![enter image description here][1]][1]
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building TestApp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/testng/testng/maven-metadata.xml
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/testng/testng/maven-metadata.xml (3 KB at 1.0 KB/sec)
[WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.testng:testng:jar:5.14.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ TestApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ TestApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\Workspace_Test\TestApp\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ TestApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ TestApp ---
[INFO] Surefire report directory: E:\Workspace_Test\TestApp\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.goibibo.tests.Tests
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@512ddf17
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 56.983 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2016-10-06T11:20:23+05:30
[INFO] Final Memory: 12M/158M
[INFO] ------------------------------------------------------------------------
还可以找到附加的maven项目结构截图和报告截图

pom.xml文件如下所示

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>TestApp</groupId>
    <artifactId>TestApp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <build>
<!--    <sourceDirectory>src</sourceDirectory>-->
        <resources>
            <resource>
                <directory>Data</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <fork>true</fork>
                        <executable>C:\Program Files\Java\jdk1.8.0_101\bin\javac.exe</executable>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>


                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <!-- <reportsDirectory>>${test.results.dir}/${run.time}</reportsDirectory> -->
                        <outputDirectory>${basedir}/target/surefire-reports/</outputDirectory>
                    </configuration>
                    <!-- <executions> <execution> <phase>test</phase> <goals> <goal>report-only</goal> 
                        </goals> </execution> </executions> -->
                </plugin>

            </plugins>

            </build>
    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.53.1</version>
        </dependency>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.4</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.10</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <scope>compile</scope>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <scope>compile</scope>
            <version>2.7</version>
        </dependency>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <scope>compile</scope>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <scope>compile</scope>
            <version>1.7</version>
        </dependency>
    </dependencies>
</project>

4.0.0
特斯塔普
特斯塔普
0.0.1-快照
资料
**/*.爪哇
maven编译器插件
3.1
真的
C:\ProgramFiles\Java\jdk1.8.0\u 101\bin\javac.exe
1.8
1.8
org.apache.maven.plugins
maven surefire报告插件
2.19.1
${basedir}/target/surefire报告/
org.seleniumhq.selenium
硒爪哇
2.53.1
org.mons
报告
1.1.4
org.testng
testng
6.9.10
编译
com.google.inject
圭斯
编译
2
com.google.code.gson
格森
编译
2.7
木卫一
java客户端
编译
2.1.0
org.apache.velocity
速度
编译
1.7

如果您使用TestNG,本文可能会帮助您:


如果您使用TestNG,本文可能会帮助您:


首先修复此错误:
org.testng:testng:jar:5.14.3…
我已经有org.testng-testng-6.9.10编译了第一个修复此错误:
org.testng:testng:jar:5.14.3…
我已经有org.testng-testng-6.9.10编译了它显示的是空白报告,没有css,现在显示的所有内容都是0%testng报告。您正在使用testng/JUnit吗?你能提供你的POM文件吗?我已经添加了POM.xml文件。你的代码运行得很好吗?现在生成输出了吗?代码运行得很好,但是现在报告显示的是testng报告,而不是..\TestApp\target\surefire reports Folder中的surefire报告。它显示的是空白报告,没有css,所有内容都是0%,现在显示的是testng报告。您正在使用TestNG/JUnit吗?你能提供你的POM文件吗?我已经添加了POM.xml文件。你的代码运行正常吗?现在生成输出了吗?代码运行正常,但是现在报告显示的是testng报告,而不是..\TestApp\target\surefire reports文件夹中的surefire报告