on xenial help sign in
Fix lifecycle tests and rename the wait assertion in Greeter emulator.
commitff1b2bc36873c4670e6f2a65f056878f07c3fe40 authorMichał Sawicz <michal.sawicz@canonical.com> dateMon 8 Sep 2014, 12:33 (12 years ago) parentda9543f
3 files changed+8−6
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+4−2 tests/autopilot/unity8/process_helpers.py+2−2 tests/autopilot/unity8/shell/emulators/greeter.py+2−2
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+4−2
@@ -97,7 +97,8 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
9797 self.assertThat(greeter.created, Eventually(Equals(True)))
9898
9999 application_name = self.launch_fake_app()
100− self.assertThat(greeter.created, Eventually(Equals(False)))
100+ greeter.wait_swiped_away()
101+ process_helpers.unlock_unity()
101102 self.assert_current_focused_application(application_name)
102103
103104 def test_greeter_hides_on_app_focus(self):
@@ -113,7 +114,8 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
113114 self.assertThat(greeter.created, Eventually(Equals(True)))
114115
115116 self.launch_upstart_application(application_name)
116− self.assertThat(greeter.created, Eventually(Equals(False)))
117+ greeter.wait_swiped_away()
118+ process_helpers.unlock_unity()
117119 self.assert_current_focused_application(application_name)
118120
119121 def test_click_dash_icon_must_unfocus_application(self):
tests/autopilot/unity8/process_helpers.py+2−2
@@ -91,7 +91,7 @@ def unlock_unity(unity_proxy_obj=None):
9191 logger.info("Failed to unlock greeter")
9292 raise
9393 else:
94− greeter.wait_unlocked()
94+ greeter.created.wait_for(False)
9595 logger.info("Greeter unlocked, continuing.")
9696
9797
@@ -193,7 +193,7 @@ def get_job_status(name):
193193 ], universal_newlines=True)
194194 except subprocess.CalledProcessError as error:
195195 raise JobError(
196− "Unable to get {}'s status: {}".format(name, error)
196+ "Unable to get {}'s status: {}".format(name, error)
197197 )
198198
199199
tests/autopilot/unity8/shell/emulators/greeter.py+2−2
@@ -25,7 +25,7 @@ from unity8.shell.emulators import UnityEmulatorBase
2525class Greeter(UnityEmulatorBase):
2626 """An emulator that understands the greeter screen."""
2727
28− def wait_unlocked(self):
28+ def wait_swiped_away(self):
2929 self.showProgress.wait_for(0)
3030
3131 def swipe(self):
@@ -40,7 +40,7 @@ class Greeter(UnityEmulatorBase):
4040 stop_y = start_y
4141 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
4242
43− self.wait_unlocked()
43+ self.wait_swiped_away()
4444
4545 def get_prompt(self):
4646 return self.select_single(