@@ -30,7 +30,7 @@ from autopilot.platform import model
31from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
31from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
33−from testtools.matchers import Equals
33+from testtools.matchers import Equals, NotEquals
36logger = logging.getLogger(__name__)
36logger = logging.getLogger(__name__)
@@ -122,29 +122,40 @@ X-Ubuntu-Touch=true""")
122 self.launch_unity()
122 self.launch_unity()
123 self.main_window.get_greeter().swipe()
123 self.main_window.get_greeter().swipe()
125− #import pdb; pdb.set_trace()
127− test_qml = self._get_qml_script()
125+ test_qml = self._get_qml_script("TestApp")
128 app = self._start_qml_script(test_qml)
126 app = self._start_qml_script(test_qml)
129− main_window = app.select_single("Page")
127+ main_window = app.select_single(
129+ objectName="TestApp"
131− self.assertThat(main_window.title, Equals("Test App"))
132+ self.assertThat(main_window, NotEquals(None))
132 self.assertThat(main_window.visible, Equals(True))
133 self.assertThat(main_window.visible, Equals(True))
134 def test_can_launch_multiple_applications(self):
135 def test_can_launch_multiple_applications(self):
135 """A second application launched must be usable."""
136 """A second application launched must be usable."""
136 self.launch_unity()
137 self.launch_unity()
137 self.main_window.get_greeter().swipe()
138 self.main_window.get_greeter().swipe()
138− first_app = self._start_qml_script(self._get_qml_script("App 1"))
139+ first_app = self._start_qml_script(self._get_qml_script("App1"))
139− second_app = self._start_qml_script(self._get_qml_script("App 2"))
140+ second_app = self._start_qml_script(self._get_qml_script("App2"))
141− first_main_window = first_app.select_single("Page")
142+ first_main_window = first_app.select_single(
142− second_main_window = second_app.select_single("Page")
146+ second_main_window = second_app.select_single(
151+ import pdb; pdb.set_trace()
144 self.assertThat(first_main_window.visible, Equals(False))
152 self.assertThat(first_main_window.visible, Equals(False))
146− self.assertThat(second_main_window.title, Equals("App 2"))
147 self.assertThat(second_main_window.visible, Equals(True))
154 self.assertThat(second_main_window.visible, Equals(True))
156+ second_main_window.select_single("Text").text,
149 def test_app_moves_from_unfocused_to_focused(self):
160 def test_app_moves_from_unfocused_to_focused(self):
150 """An application that is in the unfocused state must be able to be
161 """An application that is in the unfocused state must be able to be
@@ -153,15 +164,21 @@ X-Ubuntu-Touch=true""")
154 self.launch_unity()
165 self.launch_unity()
155 self.main_window.get_greeter().swipe()
166 self.main_window.get_greeter().swipe()
156− first_app = self._start_qml_script(self._get_qml_script("App 1"))
167+ first_app = self._start_qml_script(self._get_qml_script("App1"))
157− self._start_qml_script(self._get_qml_script("App 2"))
168+ self._start_qml_script(self._get_qml_script("App2"))
159− first_main_window = first_app.select_single("Page")
170+ first_main_window = first_app.select_single(
161 self.swipe_from_right()
175 self.swipe_from_right()
163− self.assertThat(first_main_window.title, Equals("App 1"))
164 self.assertThat(first_main_window.visible, Equals(True))
177 self.assertThat(first_main_window.visible, Equals(True))
179+ first_main_window.select_single("Text").text,
166 # interact with it . . .
183 # interact with it . . .
167 # self.assertThat(first_main_window.visible, Equals(True))
184 # self.assertThat(first_main_window.visible, Equals(True))