on xenial help sign in
Fix autopilot harder
commit698a2ad418216bb8b91fc37d210e88d2cf6d151e authorMichael Terry <michael.terry@canonical.com> dateFri 6 Feb 2015, 17:12 (12 years ago) parent3c84899
1 file changed+16−1
tests/autopilot/unity8/shell/emulators/greeter.py+16−1
tests/autopilot/unity8/shell/emulators/greeter.py+16−1
@@ -19,6 +19,7 @@
1919
2020import ubuntuuitoolkit
2121
22+from autopilot.utilities import sleep
2223from unity8.shell.emulators import UnityEmulatorBase
2324
2425
@@ -26,7 +27,21 @@ class Greeter(UnityEmulatorBase):
2627 """An emulator that understands the greeter screen."""
2728
2829 def wait_swiped_away(self):
29− self.required.wait_for(False)
30+ # We have to be careful here, because coverPage can go away at any time
31+ # if there isn't a lockscreen behind it (it hides completely, then
32+ # the greeter disposes it). But if there *is* a lockscreen, then we
33+ # need a different check, by looking at its showProgress. So make our
34+ # own wait_for loop and check both possibilities.
35+ for i in range(10):
36+ if not self.required:
37+ return
38+ coverPage = self.select_single(objectName='coverPage')
39+ if coverPage.showProgress == 0:
40+ return
41+ sleep(1)
42+
43+ raise AssertionError("Greeter cover page still up after 10s")
44+
3045
3146 def swipe(self):
3247 """Swipe the greeter screen away."""