1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

framework/execution: Only add screenshots as an artifact if present

When attempting to take a screenshot from a device do not try to add it
as an artifact if screenshot failed and is not present.
This commit is contained in:
Marc Bonnici 2018-05-23 14:56:35 +01:00 committed by setrofim
parent c3854e89c7
commit 30f856abe0

View File

@ -227,7 +227,8 @@ class ExecutionContext(object):
def take_screenshot(self, filename):
filepath = self._get_unique_filepath(filename)
self.tm.target.capture_screen(filepath)
self.add_artifact('screenshot', filepath, kind='log')
if os.path.isfile(filepath):
self.add_artifact('screenshot', filepath, kind='log')
def take_uiautomator_dump(self, filename):
filepath = self._get_unique_filepath(filename)