@@ -30,7 +30,7 @@ from autopilot.platform import model
3030
3131from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
3232
33−from testtools.matchers import Equals
33+from testtools.matchers import Equals, NotEquals
3434
3535
3636logger = logging.getLogger(__name__)
@@ -122,29 +122,40 @@ X-Ubuntu-Touch=true""")
122122 self.launch_unity()
123123 self.main_window.get_greeter().swipe()
124124
125− #import pdb; pdb.set_trace()
126−
127− test_qml = self._get_qml_script()
125+ test_qml = self._get_qml_script("TestApp")
128126 app = self._start_qml_script(test_qml)
129− main_window = app.select_single("Page")
127+ main_window = app.select_single(
128+ "QQuickRectangle",
129+ objectName="TestApp"
130+ )
130131
131− self.assertThat(main_window.title, Equals("Test App"))
132+ self.assertThat(main_window, NotEquals(None))
132133 self.assertThat(main_window.visible, Equals(True))
133134
134135 def test_can_launch_multiple_applications(self):
135136 """A second application launched must be usable."""
136137 self.launch_unity()
137138 self.main_window.get_greeter().swipe()
138− first_app = self._start_qml_script(self._get_qml_script("App 1"))
139− second_app = self._start_qml_script(self._get_qml_script("App 2"))
139+ first_app = self._start_qml_script(self._get_qml_script("App1"))
140+ second_app = self._start_qml_script(self._get_qml_script("App2"))
140141
141− first_main_window = first_app.select_single("Page")
142− second_main_window = second_app.select_single("Page")
142+ first_main_window = first_app.select_single(
143+ "QQuickRectangle",
144+ objectName="App1"
145+ )
146+ second_main_window = second_app.select_single(
147+ "QQuickRectangle",
148+ objectName="App2"
149+ )
143150
151+ import pdb; pdb.set_trace()
144152 self.assertThat(first_main_window.visible, Equals(False))
145153
146− self.assertThat(second_main_window.title, Equals("App 2"))
147154 self.assertThat(second_main_window.visible, Equals(True))
155+ self.assertThat(
156+ second_main_window.select_single("Text").text,
157+ Equals("App2")
158+ )
148159
149160 def test_app_moves_from_unfocused_to_focused(self):
150161 """An application that is in the unfocused state must be able to be
@@ -153,15 +164,21 @@ X-Ubuntu-Touch=true""")
153164 """
154165 self.launch_unity()
155166 self.main_window.get_greeter().swipe()
156− first_app = self._start_qml_script(self._get_qml_script("App 1"))
157− self._start_qml_script(self._get_qml_script("App 2"))
167+ first_app = self._start_qml_script(self._get_qml_script("App1"))
168+ self._start_qml_script(self._get_qml_script("App2"))
158169
159− first_main_window = first_app.select_single("Page")
170+ first_main_window = first_app.select_single(
171+ "QQuickRectangle",
172+ objectName="App1"
173+ )
160174
161175 self.swipe_from_right()
162176
163− self.assertThat(first_main_window.title, Equals("App 1"))
164177 self.assertThat(first_main_window.visible, Equals(True))
178+ self.assertThat(
179+ first_main_window.select_single("Text").text,
180+ Equals("App1")
181+ )
165182
166183 # interact with it . . .
167184 # self.assertThat(first_main_window.visible, Equals(True))