import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.remote.DesiredCapabilities;
}
screenshotBaseName = className + "-" + testMethod;
- };
+ }
+
+ @Override
+ protected void failed(Throwable e, Description description) {
+
+ // Notify Teamcity of failed test
+ System.out.print("##teamcity[publishArtifacts '");
+ System.out.println(getScreenshotErrorDirectory() + "/"
+ + getScreenshotBaseName() + "* => screenshot-errors']");
+ }
};
/**
</batchtest>
</junit>
+ <!-- Have teamcity publish each test error artifact immediatly if there are any -->
+ <basename property="basename" file="${target}" suffix="java" />
+ <echo>##teamcity[publishArtifacts '${com.vaadin.testbench.screenshot.directory}/errors/${basename}* => screenshot-errors']</echo>
+
</target>
<!-- Remove temporary source and compiled java files -->