UITest: disable screenshots by default

This commit is contained in:
Yuriy Artamonov 2011-08-03 11:55:37 +00:00
parent 607de81bc7
commit 36cc92bde9

View File

@ -56,6 +56,8 @@ public abstract class UITestCase extends TestCase {
private Process clientRunner;
private boolean makeScreenshot = false;
public UITestCase() {
super();
}
@ -79,17 +81,16 @@ public abstract class UITestCase extends TestCase {
StringBuilder info = new StringBuilder();
executeTestScript(executorScript, testFileName, errors, info);
String outDirPath = getOutputPath();
List<UITestStep> testSteps = analyzeTestSteps(info.toString(), errors.toString());
for (UITestStep testStep : testSteps) {
if (!testStep.isSuccess()) {
captureScreen(outDirPath + getName() + ".png");
break;
}
int i = 0;
while (i < testSteps.size() && testSteps.get(i).isSuccess()) {
i++;
}
String outDirPath = getOutputPath();
saveLog(testSteps, outDirPath + getName() + ".log");
if (i < testSteps.size() && makeScreenshot)
captureScreen(outDirPath + getName() + ".png");
return testSteps;
}
@ -311,4 +312,12 @@ public abstract class UITestCase extends TestCase {
}
return result;
}
protected boolean isMakeScreenshot() {
return makeScreenshot;
}
protected void setMakeScreenshot(boolean makeScreenshot) {
this.makeScreenshot = makeScreenshot;
}
}