diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2017-11-24 23:07:02 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-11-24 15:40:58 +0000 |
commit | 4ffe3d240e2ed30346f7cedef4838d1af768b466 (patch) | |
tree | 7274a168ec698f662d425724a674a60e8f7541a5 /automated/android/apk-automation/quadrantpro.py | |
parent | 8e1037b981182da0464f3e44f41978541111afd5 (diff) |
android apk-automation: add some improvements
1. print trace information as well when exception raised in module implementation
2. add sleep before calling of self.vc.dump() in dump_always, since dump_always
might be called in while loop in the module implementation, and call dump_always
immediately without sleep would cause failures
3. add sleep after the "am start" command as a workaround for the -W option,
in the new tag r34, this -W option seems not work as expected which makes the am start
commnd only return after the activity displayed completely.
sometimes this command will return before the activity displayed completely.
but this should be just a workaround for better fault tolerance
4. improved some module implementation for better fault tolerance
Change-Id: I1f9c6f0a3c40447de53b1b1d558c1dbc2e3164db
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'automated/android/apk-automation/quadrantpro.py')
-rwxr-xr-x | automated/android/apk-automation/quadrantpro.py | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/automated/android/apk-automation/quadrantpro.py b/automated/android/apk-automation/quadrantpro.py index 8ca7b0d..3360a2b 100755 --- a/automated/android/apk-automation/quadrantpro.py +++ b/automated/android/apk-automation/quadrantpro.py @@ -19,29 +19,39 @@ class ApkRunnerImpl(ApkTestRunner): super(ApkRunnerImpl, self).tearDown() 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() + need_continue = True + while need_continue: + self.dump_always() + view_license_btn = self.vc.findViewWithText("View license") + run_full_item = self.vc.findViewWithText(u'Run full benchmark') + if view_license_btn: + ok_button = self.vc.findViewWithTextOrRaise("OK") + ok_button.touch() + elif run_full_item: + run_full_item.touch() + need_continue = False + else: + # continue check + pass # Hack workaround to kill the first time start up # then it will work from 2nd time self.call_adb("shell am force-stop %s" % self.config['apk_package']) self.call_adb("shell am start -W -S %s" % self.config['activity']) - 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() + need_continue = True + while need_continue: + self.dump_always() + view_license_btn = self.vc.findViewWithText("View license") + run_full_item = self.vc.findViewWithText(u'Run full benchmark') + if view_license_btn: + ok_button = self.vc.findViewWithTextOrRaise("OK") + ok_button.touch() + elif run_full_item: + run_full_item.touch() + need_continue = False + else: + # continue check + pass finished = False while not finished: |