當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。