Browse Source

Publish error artifacts immediatly in TeamCity

Change-Id: I69cb2208b7f6b3263ddb25fa26eebebcc6f9a7c3
tags/7.1.7
John Ahlroos 10 years ago
parent
commit
5fb1da2da0
2 changed files with 15 additions and 1 deletions
  1. 11
    1
      uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java
  2. 4
    0
      uitest/test.xml

+ 11
- 1
uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java View File

@@ -31,6 +31,7 @@ import org.junit.Before;
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;
@@ -65,7 +66,16 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test {
}

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']");
}
};

/**

+ 4
- 0
uitest/test.xml View File

@@ -134,6 +134,10 @@
</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 -->

Loading…
Cancel
Save