当前位置: 首页>>代码示例>>Java>>正文


Java Reporter.setCurrentTestResult方法代码示例

本文整理汇总了Java中org.testng.Reporter.setCurrentTestResult方法的典型用法代码示例。如果您正苦于以下问题:Java Reporter.setCurrentTestResult方法的具体用法?Java Reporter.setCurrentTestResult怎么用?Java Reporter.setCurrentTestResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.testng.Reporter的用法示例。


在下文中一共展示了Reporter.setCurrentTestResult方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterInvocation

import org.testng.Reporter; //导入方法依赖的package包/类
/**
 * Perform post-invocation processing:
 * <ul>
 *     <li>If indicated, close the driver that was acquired for this method.</li>
 * </ul>
 * 
 * @param invokedMethod an object representing the method that's just been invoked
 * @param testResult test result object for the method that's just been invoked
 */
@Override
public void afterInvocation(IInvokedMethod invokedMethod, ITestResult testResult) {
    // ensure current test result is set
    Reporter.setCurrentTestResult(testResult);
    
    Object obj = testResult.getInstance();
    Method method = invokedMethod.getTestMethod().getConstructorOrMethod().getMethod();
    
    DriverManager.afterInvocation(obj, method);
}
 
开发者ID:Nordstrom,项目名称:Selenium-Foundation,代码行数:20,代码来源:DriverListener.java

示例2: retry

import org.testng.Reporter; //导入方法依赖的package包/类
@Override
public boolean retry(ITestResult result) {
	if (retryCount <= maxRetryCount) {
		String message = "Retry for [" + result.getName() + "] on class [" + result.getTestClass().getName() + "] Retry "
				+ retryCount + " times";
		logger.info(message);
		Reporter.setCurrentTestResult(result);
		Reporter.log("RunCount=" + (retryCount + 1));
		retryCount++;
		return true;
	}
	return false;
}
 
开发者ID:quanqinle,项目名称:WebAndAppUITesting,代码行数:14,代码来源:TestngRetry.java

示例3: beforeInvocation

import org.testng.Reporter; //导入方法依赖的package包/类
/**
 * Perform pre-invocation processing:
 * <ul>
 *     <li>Ensure that a driver instance has been created for the test.</li>
 *     <li>Store the driver instance for subsequent dispensing.</li>
 *     <li>Manage configured driver timeout intervals.</li>
 *     <li>If specified, open the initial page, storing the page object for subsequent dispensing.</li>
 * </ul>
 * 
 * @param invokedMethod an object representing the method that's about to be invoked
 * @param testResult test result object for the method that's about to be invoked
 */
@Override
public void beforeInvocation(IInvokedMethod invokedMethod, ITestResult testResult) {
    // ensure current test result is set
    Reporter.setCurrentTestResult(testResult);
    
    Object obj = testResult.getInstance();
    Method method = invokedMethod.getTestMethod().getConstructorOrMethod().getMethod();
    
    DriverManager.beforeInvocation(obj, method);
}
 
开发者ID:Nordstrom,项目名称:Selenium-Foundation,代码行数:23,代码来源:DriverListener.java


注:本文中的org.testng.Reporter.setCurrentTestResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。