mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 12:58:36 +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:
parent
41b52178bb
commit
558e40698b
@ -619,7 +619,7 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
|
|||||||
self.pull_file(on_device_file, filepath)
|
self.pull_file(on_device_file, filepath)
|
||||||
self.delete_file(on_device_file)
|
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."""
|
"""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')
|
on_device_file = self.path.join(self.working_directory, 'screen_capture.xml')
|
||||||
self.execute('uiautomator dump {}'.format(on_device_file))
|
self.execute('uiautomator dump {}'.format(on_device_file))
|
||||||
|
@ -742,7 +742,7 @@ class Runner(object):
|
|||||||
filepath = os.path.join(self.context.output_directory, filename)
|
filepath = os.path.join(self.context.output_directory, filename)
|
||||||
else:
|
else:
|
||||||
filepath = os.path.join(settings.output_directory, filename)
|
filepath = os.path.join(settings.output_directory, filename)
|
||||||
self.device.capture_view_hierachy(filepath)
|
self.device.capture_ui_hierarchy(filepath)
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def _handle_errors(self, action, on_error_status=IterationResult.FAILED):
|
def _handle_errors(self, action, on_error_status=IterationResult.FAILED):
|
||||||
@ -764,7 +764,7 @@ class Runner(object):
|
|||||||
try:
|
try:
|
||||||
self._take_screenshot('error.png')
|
self._take_screenshot('error.png')
|
||||||
if self.device.platform == 'android':
|
if self.device.platform == 'android':
|
||||||
self._take_uiautomator_dump('error.xml')
|
self._take_uiautomator_dump('error.uix')
|
||||||
except Exception, e: # pylint: disable=W0703
|
except Exception, e: # pylint: disable=W0703
|
||||||
# We're already in error state, so the fact that taking a
|
# We're already in error state, so the fact that taking a
|
||||||
# screenshot failed is not surprising...
|
# screenshot failed is not surprising...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user