diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-03-30 18:54:46 +0100 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-04-28 09:50:02 +0000 |
commit | ab48dcadc4eb74a126a8d76bece720ab000b1452 (patch) | |
tree | 4cf508236cf2cf8d44ff2552bf7b2d7a6fdee58b /automated/android/apk-automation/quadrantpro.py | |
parent | d92cc5a7e7461e7fe493a3a1be0bbdc7a94f9892 (diff) |
automated: android: add refactored apk-automation
Change-Id: I5a81b3c4317dc56f90df37c5a8f83d2547542fab
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'automated/android/apk-automation/quadrantpro.py')
-rwxr-xr-x | automated/android/apk-automation/quadrantpro.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/automated/android/apk-automation/quadrantpro.py b/automated/android/apk-automation/quadrantpro.py new file mode 100755 index 0000000..6c39028 --- /dev/null +++ b/automated/android/apk-automation/quadrantpro.py @@ -0,0 +1,47 @@ +from common import ApkTestRunner +from com.dtmilano.android.viewclient import ViewNotFoundException + + +class ApkRunnerImpl(ApkTestRunner): + def __init__(self, config): + self.config = config + self.config['apk_file_name'] = 'com.aurorasoftworks.quadrant.ui.professional-1.apk' + self.config['apk_package'] = 'com.aurorasoftworks.quadrant.ui.professional' + self.config['activity'] = 'com.aurorasoftworks.quadrant.ui.professional/.QuadrantProfessionalLauncherActivity' + super(ApkRunnerImpl, self).__init__(self.config) + + def execute(self): + self.dump_always() + view_license_btn = self.vc.findViewWithText("View license") + if view_license_btn: + ok_button = self.vc.findViewWithTextOrRaise("OK") + ok_button.touch() + + self.dump_always() + run_full_item = self.vc.findViewWithTextOrRaise(u'Run full benchmark') + run_full_item.touch() + + finished = False + while not finished: + try: + self.dump_always() + self.vc.findViewByIdOrRaise("com.aurorasoftworks.quadrant.ui.professional:id/chart") + finished = True + self.logger.info('Benchmark finished') + except ViewNotFoundException: + pass + except RuntimeError: + pass + except ValueError: + pass + + def parseResult(self): + raw_output_file = "%s/logcat-quadrandpro-itr%s.log" % (self.config['output'], self.config['itr']) + self.call_adb('logcat -d -v brief > %s' % raw_output_file) + + with open(raw_output_file) as logfile: + for line in logfile: + if 'aggregate score is' in line: + tc_id = line.split()[3].replace('_', '-') + measurement = line.split()[-1] + self.report_result('quadrandpro-%s' % tc_id, 'pass', measurement, 'points') |