@@ -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."""