@@ -31,58 +31,11 @@ class Greeter(Unity8EmulatorBase):
3131 touch = Touch.create()
3232
3333 # TODO: Is this ever called? Find out, and maybe remove this branch:
34− if self.multiUser:
35− # this is borked!
36− password_field = self.select_greeter_user("No Password")
37− password_field.opacity.wait_for(1)
38− touch.tap_object(password_field)
39−
40− else:
41− rect = self.globalRect
42− start_x = rect[0] + rect[2] - 3
43− start_y = int(rect[1] + rect[3] / 2)
44− stop_x = int(rect[0] + rect[2] * 0.2)
45− stop_y = start_y
46− touch.drag(start_x, start_y, stop_x, stop_y)
34+ rect = self.globalRect
35+ start_x = rect[0] + rect[2] - 3
36+ start_y = int(rect[1] + rect[3] / 2)
37+ stop_x = int(rect[0] + rect[2] * 0.2)
38+ stop_y = start_y
39+ touch.drag(start_x, start_y, stop_x, stop_y)
4740
4841 self.created.wait_for(False)
49−
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)))
56−
57− login_loader = self.main_window.get_login_loader()
58− self.assertThat(login_loader.progress, Eventually(Equals(1)))
59−
60− login_list = self.main_window.get_login_list()
61− list_view = login_list.get_children_by_type("QQuickListView")[0]
62−
63− try_count = 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")
67− target_user = None
68− for user in users:
69− try:
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:
74− target_user = user
75− break
76− elif target_user is None or user.y > target_user.y:
77− target_user = user
78− except Exception:
79− pass
80− if target_user is None:
81− break
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