summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-08-15 19:47:06 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2018-08-16 09:06:27 +0000
commitcb654e6bd6b0db6fbd69b19c172b2a6fe9b93b6d (patch)
tree37e3579b88d04784ef071c72e637161feb4a5463 /automated
parent1bab3b59a8f6ee96dd5dc1ef0c19d42f16af6b91 (diff)
android apk-automation: update some benchamrks to work with pie and later
when run some tests on pie builds, the older version dialog was popped up, and we need to press the OK button there to make the benchmark apks continue. This this change is to fix that problem. Change-Id: I5ae0607b72277b2b9008a6cd9464eb33e28c0021 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/android/apk-automation/benchmarkpi.py17
-rwxr-xr-xautomated/android/apk-automation/caffeinemark.py17
-rwxr-xr-xautomated/android/apk-automation/cf-bench.py21
-rwxr-xr-xautomated/android/apk-automation/javawhetstone.py18
-rwxr-xr-xautomated/android/apk-automation/linpack.py41
5 files changed, 79 insertions, 35 deletions
diff --git a/automated/android/apk-automation/benchmarkpi.py b/automated/android/apk-automation/benchmarkpi.py
index 94e198d..41a70ec 100755
--- a/automated/android/apk-automation/benchmarkpi.py
+++ b/automated/android/apk-automation/benchmarkpi.py
@@ -13,10 +13,19 @@ class ApkRunnerImpl(ApkTestRunner):
super(ApkRunnerImpl, self).__init__(self.config)
def execute(self):
- time.sleep(2)
- self.dump_always()
- start_button = self.vc.findViewByIdOrRaise("gr.androiddev.BenchmarkPi:id/Button01")
- start_button.touch()
+ find_start_btn = False
+ while not find_start_btn:
+ time.sleep(2)
+ self.dump_always()
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
+ if warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
+ else:
+ start_button = self.vc.findViewByIdOrRaise("gr.androiddev.BenchmarkPi:id/Button01")
+ start_button.touch()
+ find_start_btn = True
finished = False
while not finished:
diff --git a/automated/android/apk-automation/caffeinemark.py b/automated/android/apk-automation/caffeinemark.py
index 246abe9..22ce5e2 100755
--- a/automated/android/apk-automation/caffeinemark.py
+++ b/automated/android/apk-automation/caffeinemark.py
@@ -20,10 +20,19 @@ class ApkRunnerImpl(ApkTestRunner):
super(ApkRunnerImpl, self).tearDown()
def execute(self):
- time.sleep(2)
- self.dump_always()
- start_button = self.vc.findViewByIdOrRaise("com.flexycore.caffeinemark:id/startButton")
- start_button.touch()
+ find_start_btn = False
+ while not find_start_btn:
+ time.sleep(2)
+ self.dump_always()
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
+ if warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
+ else:
+ start_button = self.vc.findViewByIdOrRaise("com.flexycore.caffeinemark:id/startButton")
+ start_button.touch()
+ find_start_btn = True
finished = False
while not finished:
diff --git a/automated/android/apk-automation/cf-bench.py b/automated/android/apk-automation/cf-bench.py
index afe6bab..44014ff 100755
--- a/automated/android/apk-automation/cf-bench.py
+++ b/automated/android/apk-automation/cf-bench.py
@@ -1,5 +1,6 @@
import re
import time
+
from common import ApkTestRunner
from com.dtmilano.android.viewclient import ViewNotFoundException
@@ -13,12 +14,20 @@ class ApkRunnerImpl(ApkTestRunner):
super(ApkRunnerImpl, self).__init__(self.config)
def execute(self):
- time.sleep(2)
- self.dump_always()
-
- # Start test button
- start_button = self.vc.findViewWithTextOrRaise("Full Benchmark")
- start_button.touch()
+ find_start_btn = False
+ while not find_start_btn:
+ time.sleep(2)
+ self.dump_always()
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
+ if warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
+ else:
+ # Start test button
+ start_button = self.vc.findViewWithTextOrRaise("Full Benchmark")
+ start_button.touch()
+ find_start_btn = True
# Wait while cf-bench running
finished = False
diff --git a/automated/android/apk-automation/javawhetstone.py b/automated/android/apk-automation/javawhetstone.py
index 2702b24..a2ac10a 100755
--- a/automated/android/apk-automation/javawhetstone.py
+++ b/automated/android/apk-automation/javawhetstone.py
@@ -21,11 +21,21 @@ class ApkRunnerImpl(ApkTestRunner):
super(ApkRunnerImpl, self).tearDown()
def execute(self):
- self.dump_always()
- btn_run = self.vc.findViewByIdOrRaise("com.roywhet:id/startButton")
- btn_run.touch()
- time.sleep(2)
+ find_start_btn = False
+ while not find_start_btn:
+ time.sleep(2)
+ self.dump_always()
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
+ if warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
+ else:
+ btn_run = self.vc.findViewByIdOrRaise("com.roywhet:id/startButton")
+ btn_run.touch()
+ find_start_btn = True
+ time.sleep(2)
finished = False
while not finished:
try:
diff --git a/automated/android/apk-automation/linpack.py b/automated/android/apk-automation/linpack.py
index d71687f..517e8c9 100755
--- a/automated/android/apk-automation/linpack.py
+++ b/automated/android/apk-automation/linpack.py
@@ -12,19 +12,27 @@ class ApkRunnerImpl(ApkTestRunner):
def execute(self):
# single core test.
- time.sleep(2)
- self.dump_always()
- start_single_button = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/btnsingle")
- start_single_button.touch()
-
- time.sleep(2)
- self.dump_always()
- start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
-
- while not start_single_button:
+ find_start_btn = False
+ while not find_start_btn:
time.sleep(2)
self.dump_always()
- start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
+ if warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
+ else:
+ start_single_button = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/btnsingle")
+ start_single_button.touch()
+ find_start_btn = True
+
+ # using start_single_button to check if the test finished
+ test_finished = False
+ while not test_finished:
+ time.sleep(2)
+ self.dump_always()
+ if self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle"):
+ test_finished = True
mflops_single_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txtmflops_result")
time_single_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txttime_result")
@@ -36,14 +44,13 @@ class ApkRunnerImpl(ApkTestRunner):
start_multi_button = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/btncalculate")
start_multi_button.touch()
- time.sleep(2)
- self.dump_always()
- start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
-
- while not start_single_button:
+ # using start_single_button to check if the test finished
+ test_finished = False
+ while not test_finished:
time.sleep(2)
self.dump_always()
- start_single_button = self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle")
+ if self.vc.findViewById("com.greenecomputing.linpack:id/btnsingle"):
+ test_finished = True
mflops_multi_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txtmflops_result")
time_multi_score = self.vc.findViewByIdOrRaise("com.greenecomputing.linpack:id/txttime_result")