Skip to content

Commit 4a2e7ab

Browse files
authored
chore: do not always collect logs (#73)
* chore: update appium-java-client * chore: do not collect logs on passing tests
1 parent ac334b5 commit 4a2e7ab

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/main/java/functional/tests/core/mobile/basetest/MobileSetupManager.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,22 +177,21 @@ public void initDevice() throws MobileAppException, DeviceException, TimeoutExce
177177
* @param testCase Test name.
178178
*/
179179
public void logTestResult(int previousTestStatus, String testCase) {
180-
if (this.context.device == null) {
181-
LOGGER_BASE.error("The device is null");
182-
} else {
183-
try {
184-
this.context.device.writeConsoleLogToFile(testCase);
185-
} catch (IOException e) {
186-
e.printStackTrace();
187-
}
188-
}
189-
190180
if (previousTestStatus == ITestResult.SUCCESS) {
191181
if (this.context.settings.takeScreenShotAfterTest) {
192182
this.context.log.logScreen(testCase + "_pass", "Screenshot after " + testCase);
193183
}
194184
this.log.info("=> Test " + testCase + " passed!");
195185
} else if (previousTestStatus == ITestResult.FAILURE) {
186+
if (this.context.device == null) {
187+
LOGGER_BASE.error("The device is null");
188+
} else {
189+
try {
190+
this.context.device.writeConsoleLogToFile(testCase);
191+
} catch (IOException e) {
192+
e.printStackTrace();
193+
}
194+
}
196195
this.context.log.logScreen(testCase + "_fail", "Screenshot after " + testCase);
197196
this.context.log.saveXmlTree(testCase + "_VisualTree.xml");
198197
this.log.error("=> Test " + testCase + " failed!");

0 commit comments

Comments
 (0)