@Test public void reportLogShouldBeAvailableWithListener() { TestNG tng = create(ListenerReporterSample.class); InvokedMethodNameListener listener = new InvokedMethodNameListener(); tng.addListener(listener); Reporter.clear(); tng.run(); assertThat(listener.getFailedMethodNames()).isEmpty(); assertThat(listener.getSkippedMethodNames()).isEmpty(); assertThat(listener.getSucceedMethodNames()).containsExactly("testMethod"); assertThat(Reporter.getOutput()).hasSize(2); }
@Override public void onStart(ISuite suite) { Reporter.clear(); // clear output from previous test runs Schema kmlSchema = ValidationUtils.createKMLSchema(); if (null != kmlSchema) { suite.setAttribute(SuiteAttribute.KML_SCHEMA.getName(), kmlSchema); } processSuiteParameters(suite); }
Reporter.clear(); // clear output from previous test runs Reporter.log("The result of the test is-\n\n");