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

AndroidDevice: fixing UI hierarchy capture

- renamed the capture method from "capture_view_hierachy" to
  "capture_ui_hierarchy" to fix typo and make more descriptive.
- Change the file extension of the cature file to ".uix" because this is
  the extension uiautomatorviewer looks for.
This commit is contained in:
Sergei Trofimov 2016-10-17 13:49:19 +01:00
parent 41b52178bb
commit 558e40698b
2 changed files with 3 additions and 3 deletions

View File

@ -619,7 +619,7 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
self.pull_file(on_device_file, filepath)
self.delete_file(on_device_file)
def capture_view_hierachy(self, filepath):
def capture_ui_hierarchy(self, filepath):
"""Captures the current view hierarchy into the specified file in a XML format."""
on_device_file = self.path.join(self.working_directory, 'screen_capture.xml')
self.execute('uiautomator dump {}'.format(on_device_file))

View File

@ -742,7 +742,7 @@ class Runner(object):
filepath = os.path.join(self.context.output_directory, filename)
else:
filepath = os.path.join(settings.output_directory, filename)
self.device.capture_view_hierachy(filepath)
self.device.capture_ui_hierarchy(filepath)
@contextmanager
def _handle_errors(self, action, on_error_status=IterationResult.FAILED):
@ -764,7 +764,7 @@ class Runner(object):
try:
self._take_screenshot('error.png')
if self.device.platform == 'android':
self._take_uiautomator_dump('error.xml')
self._take_uiautomator_dump('error.uix')
except Exception, e: # pylint: disable=W0703
# We're already in error state, so the fact that taking a
# screenshot failed is not surprising...