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