mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
UITest: disable screenshots by default
This commit is contained in:
parent
607de81bc7
commit
36cc92bde9
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user