on xenial help sign in
Make use of helpers in all tests. (LP: #1260860). Fixes: https://bugs.launchpad.net/bugs/1260860.

Approved by PS Jenkins bot, Michał Sawicz.

commit209d0129f70928f2dcf7ee51658dea54816ec59e authorChristopher Lee <chris.lee@canonical.com> dateTue 17 Dec 2013, 11:44 (13 years ago) parent2f4ac8e52d688e
2 files changed+16−14
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7−6 tests/autopilot/unity8/shell/tests/test_lock_screen.py+9−8
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7−6
@@ -21,6 +21,7 @@
2121
2222from __future__ import absolute_import
2323
24+from unity8.process_helpers import unlock_unity
2425from unity8.shell import disable_qml_mocking
2526from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2627
@@ -78,8 +79,8 @@ class ApplicationLifecycleTests(UnityTestCase):
7879 @disable_qml_mocking
7980 def test_can_launch_application(self):
8081 """Must be able to launch an application."""
81− self.launch_unity()
82− self.main_window.get_greeter().swipe()
82+ unity_proxy = self.launch_unity()
83+ unlock_unity(unity_proxy)
8384
8485 app = self._launch_app("messaging-app")
8586
@@ -92,8 +93,8 @@ class ApplicationLifecycleTests(UnityTestCase):
9293 @disable_qml_mocking
9394 def test_can_launch_multiple_applications(self):
9495 """A second application launched must be focused."""
95− self.launch_unity()
96− self.main_window.get_greeter().swipe()
96+ unity_proxy = self.launch_unity()
97+ unlock_unity(unity_proxy)
9798
9899 self._launch_app("messaging-app")
99100 self.assertThat(
@@ -113,8 +114,8 @@ class ApplicationLifecycleTests(UnityTestCase):
113114 brought back to the focused state.
114115
115116 """
116− self.launch_unity()
117− self.main_window.get_greeter().swipe()
117+ unity_proxy = self.launch_unity()
118+ unlock_unity(unity_proxy)
118119
119120 self._launch_app("messaging-app")
120121 self.assertThat(
tests/autopilot/unity8/shell/tests/test_lock_screen.py+9−8
@@ -20,6 +20,7 @@
2020
2121from __future__ import absolute_import
2222
23+from unity8.process_helpers import unlock_unity
2324from unity8.shell import with_lightdm_mock
2425from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2526
@@ -40,11 +41,11 @@ class TestLockscreen(UnityTestCase):
4041 @with_lightdm_mock("single-pin")
4142 def test_can_unlock_pin_screen(self):
4243 """Must be able to unlock the PIN entry lock screen."""
43− self.launch_unity()
44+ unity_proxy = self.launch_unity()
4445 greeter = self.main_window.get_greeter()
4546
4647 if greeter.narrowMode:
47− greeter.swipe()
48+ unlock_unity(unity_proxy)
4849 lockscreen = self._wait_for_lockscreen()
4950 self._enter_pincode("1234")
5051 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -55,11 +56,11 @@ class TestLockscreen(UnityTestCase):
5556 @with_lightdm_mock("single-passphrase")
5657 def test_can_unlock_passphrase_screen(self):
5758 """Must be able to unlock the passphrase entry screen."""
58− self.launch_unity()
59+ unity_proxy = self.launch_unity()
5960 greeter = self.main_window.get_greeter()
6061
6162 if greeter.narrowMode:
62− greeter.swipe()
63+ unlock_unity(unity_proxy)
6364 lockscreen = self._wait_for_lockscreen()
6465 self._enter_pin_passphrase("password")
6566 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -70,11 +71,11 @@ class TestLockscreen(UnityTestCase):
7071 @with_lightdm_mock("single-pin")
7172 def test_pin_screen_wrong_code(self):
7273 """Entering the wrong pin code must not dismiss the lock screen."""
73− self.launch_unity()
74+ unity_proxy = self.launch_unity()
7475 greeter = self.main_window.get_greeter()
7576
7677 if greeter.narrowMode:
77− greeter.swipe()
78+ unlock_unity(unity_proxy)
7879 lockscreen = self._wait_for_lockscreen()
7980 self._enter_pincode("4321")
8081 pinentryField = self.main_window.get_pinentryField()
@@ -89,11 +90,11 @@ class TestLockscreen(UnityTestCase):
8990 @with_lightdm_mock("single-passphrase")
9091 def test_passphrase_screen_wrong_password(self):
9192 """Entering the wrong password must not dismiss the lock screen."""
92− self.launch_unity()
93+ unity_proxy = self.launch_unity()
9394 greeter = self.main_window.get_greeter()
9495
9596 if greeter.narrowMode:
96− greeter.swipe()
97+ unlock_unity(unity_proxy)
9798 lockscreen = self._wait_for_lockscreen()
9899 self._enter_pin_passphrase("foobar")
99100 pinentryField = self.main_window.get_pinentryField()