Utils.writeUtf8File(context.getOutputDirectory(),generateFileName(context) + ".xml", document.toXML());
protected void generateReport(ITestContext context) { super.generateReport(context); String dir = context.getOutputDirectory(); File directory = new File(dir); File[] files = directory.listFiles((dir1, name) -> name.endsWith(".xml")); testsuites.addAll(getSuites(files)); }
context.getOutputDirectory(), generateFileName(context) + ".xml", document.toXML());
@Override public void onFinish(ITestContext context) { generateLog(m_testContext, null /* host */, m_testContext.getOutputDirectory(), getConfigurationFailures(), getConfigurationSkips(), getPassedTests(), getFailedTests(), getSkippedTests(), getFailedButWithinSuccessPercentageTests()); } //
@Override public void onFinish(ITestContext context) { generateLog( m_testContext, null /* host */, m_testContext.getOutputDirectory(), getConfigurationFailures(), getConfigurationSkips(), getPassedTests(), getFailedTests(), getSkippedTests(), getFailedButWithinSuccessPercentageTests()); } //
OutputDirectory(ITestContext context) { path = context.getOutputDirectory(); }
OutputDirectory(ITestContext context) { path = context.getOutputDirectory(); }
public void onStart(ITestContext context) { outputDirectory = new File(context.getOutputDirectory()); }
public void setDefaultOutputDirectory(ITestContext context) { setAttribute(DEFAULT_OUTPUT_DIRECTORY, new File(context.getOutputDirectory()).getParent()); }
private static String getOutputDirectory() { String outputDirectory = null; outputDirectory = SeleniumTestsContextManager.getGlobalContext().getTestNGContext().getOutputDirectory(); return outputDirectory; }
public void setOutputDirectory(String outputDir, ITestContext context, boolean configureTestNg) { setDefaultOutputDirectory(context); if (outputDir == null) { setAttribute(OUTPUT_DIRECTORY, new File(context.getOutputDirectory()).getParent()); } else { if (context instanceof TestRunner && configureTestNg) { ((TestRunner)context).setOutputDirectory(outputDir); } setAttribute(OUTPUT_DIRECTORY, new File(outputDir).getAbsolutePath().replace(File.separator, "/")); try { new File((String)getAttribute(OUTPUT_DIRECTORY)).mkdirs(); } catch (Exception e) {} } }
File dir = new File(testContext.getOutputDirectory());
{}); File dir = new File(testContext.getOutputDirectory());
@Override public void onStart(ITestContext testContext) { super.onStart(testContext); TEST_RESOURCE_LOG.info("BrooklynLeakListener.onStart attempting to terminate all extant ManagementContexts: " + "name=" + testContext.getName() + "; includedGroups="+Arrays.toString(testContext.getIncludedGroups()) + "; excludedGroups="+Arrays.toString(testContext.getExcludedGroups()) + "; suiteName="+testContext.getSuite().getName() + "; outDir="+testContext.getOutputDirectory()); tryTerminateAll(); }
@Override public void onFinish(ITestContext testContext) { super.onFinish(testContext); TEST_RESOURCE_LOG.info("BrooklynLeakListener.onFinish attempting to terminate all extant ManagementContexts: " + "name=" + testContext.getName() + "; includedGroups="+Arrays.toString(testContext.getIncludedGroups()) + "; excludedGroups="+Arrays.toString(testContext.getExcludedGroups()) + "; suiteName="+testContext.getSuite().getName() + "; outDir="+testContext.getOutputDirectory()); tryTerminateAll(); }
@BeforeSuite @Parameters({"selenium.host", "selenium.port"}) public void attachScreenshotListener(@Optional("localhost") String host, @Optional("4444") String port, ITestContext context) { if (!"localhost".equals(host)) return; Selenium screenshotTaker = new DefaultSelenium(host, Integer.parseInt(port), "", ""); TestRunner tr = (TestRunner) context; File outputDirectory = new File(context.getOutputDirectory()); tr.addListener((IResultListener) new ScreenshotListener(outputDirectory, screenshotTaker)); }
/*** * This Method Set the driver if @BeforeMethod Configuration present if not * then set the driver for @Test Methods * * @author kapilA */ public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { // Setting the output directory if (outPutDir == null) { outPutDir = testResult.getTestContext().getOutputDirectory(); } if (method.getTestMethod().isBeforeMethodConfiguration()) { LOGGER.info("Setting the WebDriver in Before Method"); // Initializing browser so that will be same across all the child // threads Driver.browserConf.set(null); } if (method.isTestMethod()) { //if factory method is used then no need to set the browserConf to null ,it should be taken care in cleanup if (!isPartOfFactoryTest(method)) { Driver.browserConf.set(null); } // need as otherwise will produce unexpected output SAssert.m_errors.get(); SAssert.assertMap.get(); } }
+ ".png"; String outPutDirectory = testResult.getTestContext() .getOutputDirectory(); String filePath = outPutDirectory + File.separator + screenShotName;
&& SeleniumTestsContextManager.getGlobalContext().getTestNGContext() != null) { suiteName = SeleniumTestsContextManager.getGlobalContext().getTestNGContext().getSuite().getName(); outputDirectory = SeleniumTestsContextManager.getGlobalContext().getTestNGContext().getOutputDirectory();
public ScreenShot() { if (SeleniumTestsContextManager.getGlobalContext().getTestNGContext() != null) { suiteName = SeleniumTestsContextManager.getGlobalContext().getTestNGContext().getSuite().getName(); outputDirectory = SeleniumTestsContextManager.getGlobalContext().getTestNGContext().getOutputDirectory(); } }