我和testNG一起运行cucumber。CucumberRunner类扩展了AbstractTestNGCucumberTests,CucumberRunner类在testNG.xml文件中指定。
如果我用testNG.xml运行一个简单的TestNG类,那么testNG结果的输出会显示在控制台中,即总测试运行,失败,跳过,如下所示:
Test.java
package com.cucumber.test;
import org.testng.Assert;
public class Test {
@org.testng.annotations.Test
public void test()
我在控制台和报告中都得到了下面的错误。但我不希望此错误跟踪显示在报告中。如何抑制报告中显示的此错误?我使用自定义失败消息调用此函数Library.Test():我的代码是:
AssertJUnit.assertTrue("FAIL: Please check the logs in report. Either there are no more than 10 records and there is a problem in application.",Library.Test());
我的AssertionError跟踪如下:
FAILED: TC
java.lang
class use extends Test {
@org.testng.annotations.Test
public void test() throws exc {
try {
System.out.println("test");
int a = 1 / 0;
System.out.println(a);
} catch (ArithmeticException e) {
throw new exc("This is
TestNG的默认电子邮件报告在测试用例失败或断言消息时显示异常。
但是在这里,我想向通过的测试用例中添加一条消息,比如TestNG报告中的一些输出值。具体地说:
1. Submit a form in UI.
2. A success message with ID will be displayed.
3. Retrieve that ID using selenium's getText().
4. In the TestNG report, print the above-retrieved ID as "Submitted form ID: {id}".
当用
我目前正在研究在测试套件执行之后,根据testng中的参数将testng报告上传到Amazon的能力。考虑以下testng xml:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Base Framework Unit Test Suite" verbose="1" >
<parameter name="upload-test-reports" value="true" /&g
我有Jira,包括他们的插件Zephyr和ZAPI。我从Jenkins运行我的代码,如视频所示。我的代码是用Java+TestNG编写的,并且我还没有为Jenkins添加Junit插件。我的测试运行良好,但控制台输出显示: 生成结果为成功解析JUnit测试结果时出现空问题。分析surefire报告时出错。请确保"Publish JUnit test result report is added“作为生成后操作生成步骤”Publish test result to Zephyr for JIRA“标记为生成失败已完成:失败 在Jira上,它仍然显示未执行。