@@ -19,6 +19,7 @@
20import ubuntuuitoolkit
20import ubuntuuitoolkit
22+from autopilot.utilities import sleep
22from unity8.shell.emulators import UnityEmulatorBase
23from unity8.shell.emulators import UnityEmulatorBase
@@ -26,7 +27,21 @@ class Greeter(UnityEmulatorBase):
26 """An emulator that understands the greeter screen."""
27 """An emulator that understands the greeter screen."""
28 def wait_swiped_away(self):
29 def wait_swiped_away(self):
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.
29− self.required.wait_for(False)
36+ if not self.required:
38+ coverPage = self.select_single(objectName='coverPage')
39+ if coverPage.showProgress == 0:
43+ raise AssertionError("Greeter cover page still up after 10s")
31 def swipe(self):
46 def swipe(self):
32 """Swipe the greeter screen away."""
47 """Swipe the greeter screen away."""