@@ -31,58 +31,11 @@ class Greeter(Unity8EmulatorBase):
31 touch = Touch.create()
31 touch = Touch.create()
33 # TODO: Is this ever called? Find out, and maybe remove this branch:
33 # TODO: Is this ever called? Find out, and maybe remove this branch:
36− password_field = self.select_greeter_user("No Password")
37− password_field.opacity.wait_for(1)
38− touch.tap_object(password_field)
41− rect = self.globalRect
34+ rect = self.globalRect
42− start_x = rect[0] + rect[2] - 3
35+ start_x = rect[0] + rect[2] - 3
43− start_y = int(rect[1] + rect[3] / 2)
36+ start_y = int(rect[1] + rect[3] / 2)
44− stop_x = int(rect[0] + rect[2] * 0.2)
37+ stop_x = int(rect[0] + rect[2] * 0.2)
45− stop_y = start_y
38+ stop_y = start_y
46− touch.drag(start_x, start_y, stop_x, stop_y)
39+ touch.drag(start_x, start_y, stop_x, stop_y)
48 self.created.wait_for(False)
41 self.created.wait_for(False)
50− #TODO: This was moved here from helpers.TestShellHelpers
51− # Needs a cleanup (used in borked above).
52− def select_greeter_user(self, username):
53− greeter = self.main_window.get_greeter()
54− self.assertThat(greeter.created, Eventually(Equals(True)))
55− self.assertThat(greeter.multiUser, Eventually(Equals(True)))
57− login_loader = self.main_window.get_login_loader()
58− self.assertThat(login_loader.progress, Eventually(Equals(1)))
60− login_list = self.main_window.get_login_list()
61− list_view = login_list.get_children_by_type("QQuickListView")[0]
64− max_tries = 50 # just in case we go off rails
65− while try_count < max_tries:
66− users = list_view.get_children_by_type("QQuickItem")[0].get_children_by_type("QQuickItem")
70− user_label = user.get_children_by_type("Label")[0]
71− if user.opacity < 0.1:
72− continue # off-screen item
73− if user_label.text == username:
76− elif target_user is None or user.y > target_user.y:
80− if target_user is None:
82− user_label = target_user.get_children_by_type("Label")[0]
83− self.touch.tap_object(user_label)
84− self.assertThat(list_view.movingInternally, Eventually(Equals(False)))
85− if user_label.text == username:
86− return login_list.get_children_by_type("TextField")[0]
87− try_count = try_count + 1
88− self.fail() # We didn't find it