我刚刚开始尝试空手道框架,我遵循了快速入门指南(https://github.com/intuit/karate)。我成功运行了示例测试,并创建了html报告文件(target / surefire-reports / examples.users.users.html)。
我的问题是,如果测试失败(生成日志文件和xml),则不会生成html报告。 无论如何,即使测试失败,是否也可以生成html报告?
[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 1.866 s <<< FAILURE! - in examples.ExamplesTest
[ERROR] testAll[1][1] Time elapsed: 0.715 s <<< FAILURE!
org.opentest4j.AssertionFailedError:
users.feature:15 -
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
[ERROR] testAll[1][2] Time elapsed: 0.503 s <<< FAILURE!
org.opentest4j.AssertionFailedError: users.feature:37 - status code was: 201, expected: 202, response time: 484, url: https://jsonplaceholder.typicode.com/users, response: {"name":"Test User","username":"testuser","email":"test@user.com","address":{"street":"Has No Name","suite":"Apt. 123","city":"Electri","zipcode":"54321-6789"},"id":11}
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ExamplesTest.testAll users.feature:15 -
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
[ERROR] ExamplesTest.testAll users.feature:37 - status code was: 201, expected: 202, response time: 484, url: https://jsonplaceholder.typicode.com/users, response: {"name":"Test User","username":"testuser","email":"test@user.com","address":{"street":"Has No Name","suite":"Apt. 123","city":"Electri","zipcode":"54321-6789"},"id":11}
[INFO]
[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.
Please refer to /home/jezreel/projects/karate_pof/test-karate/jezproject/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
复制问题的步骤:
mvn test