Merge lp:~carla-sella/ubuntu-rssreader-app/view-feeds-test into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
- view-feeds-test
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~carla-sella/ubuntu-rssreader-app/view-feeds-test |
Merge into: | lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk |
Diff against target: |
491 lines (+246/-64) 9 files modified
feeds/AppendFeedPage.qml (+1/-1) feeds/ChooseTopicPage.qml (+2/-1) feeds/EditFeed.qml (+2/-1) feeds/ManageFeedsPage.qml (+1/-0) feeds/TopicManagement.qml (+2/-0) listview/ArticleListPage.qml (+1/-1) listview/FeedListPage.qml (+1/-1) tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py (+20/-4) tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+216/-55) |
To merge this branch: | bzr merge lp:~carla-sella/ubuntu-rssreader-app/view-feeds-test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Shorts Developers | Pending | ||
Review via email: mp+178470@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-08-13.
Commit message
autopilot ubuntu-
Description of the change
Completed view all feeds an view feed test.
Nicholas Skaggs (nskaggs) wrote : | # |
- 30. By Roman Shchekin
-
A lot of little fixes of careless mistakes.
Approved by Ubuntu Phone Apps Jenkins Bot, Joey Chan.
- 31. By Roman Shchekin
-
ListModePage.qml now can display concrete topic too.
Approved by Ubuntu Phone Apps Jenkins Bot.
- 32. By Roman Shchekin
-
Added dialog for "Refresh" operation!.
Approved by Ubuntu Phone Apps Jenkins Bot.
- 33. By Roman Shchekin
-
Debian package fix (icons included).
Approved by Ubuntu Phone Apps Jenkins Bot.
Nicholas Skaggs (nskaggs) wrote : | # |
Converting this to the emulator and rebasing to upstream trunk
Nicholas Skaggs (nskaggs) wrote : | # |
Looks good Carla, plenty of asserts in here to make sure timing doesn't bite you :-) Having all those asserts to check each step is really good. A couple things to note;
As you know English strings break things when we run in other languages, like Italian ;-) So, use the .visible property to ensure your on the proper page rather than the page title. This won't break when they rename the pages either! No need to check the title if we got the object (page) and it's visible.
We can also assert when things like text entry boxes come into focus via the .focus property. Pretty handy to make sure our text entry goes in the proper place :-)
These little things could cause issues when run on the devices, but likely doesn't effect the desktop runs, so it doesn't come up while writing.
Nicholas Skaggs (nskaggs) wrote : | # |
One other thing, the proper syntax for a lambda function within an assert is;
self.assertThat
In some cases there were a few that looked like this:
lambda: self.assertThat
Nicholas Skaggs (nskaggs) wrote : | # |
This is equivalent
def get_canonical_
itemList = self.select_
for item in itemList:
if item.text == "Canonical":
to this:
def get_canonical_
itemList = self.app.
index = -1
for item in itemList:
index += 1
if item.text == "Canonical":
See the difference? You can use item directly as it's equal to itemList[index].
- 34. By Nicholas Skaggs
-
merge carla's changes, plus initial conversion to sdk emulator
- 35. By Nicholas Skaggs
-
first working version
- 36. By Nicholas Skaggs
-
cleaned up comments, etc
- 37. By Nicholas Skaggs
-
Tweak autopilot tests, force new build into ppa.
Approved by Ubuntu Phone Apps Jenkins Bot.
- 38. By Nicholas Skaggs
-
Tweak autopilot tests, force new build into ppa.
Approved by Ubuntu Phone Apps Jenkins Bot.
- 39. By Nicholas Skaggs
-
Small cleanups for dependencies.
Approved by Ubuntu Phone Apps Jenkins Bot.
- 40. By Carla Sella
-
Autopilot view feed test needs review.
Unmerged revisions
- 40. By Carla Sella
-
Autopilot view feed test needs review.
Preview Diff
1 | === modified file 'feeds/AppendFeedPage.qml' |
2 | --- feeds/AppendFeedPage.qml 2013-08-02 19:00:56 +0000 |
3 | +++ feeds/AppendFeedPage.qml 2013-08-12 19:46:20 +0000 |
4 | @@ -9,7 +9,7 @@ |
5 | |
6 | Page { |
7 | id: appendFeedPage |
8 | - |
9 | + objectName: "appendfeedpage" |
10 | title: "Append feed" |
11 | flickable: null |
12 | visible: false |
13 | |
14 | === modified file 'feeds/ChooseTopicPage.qml' |
15 | --- feeds/ChooseTopicPage.qml 2013-08-04 08:51:35 +0000 |
16 | +++ feeds/ChooseTopicPage.qml 2013-08-12 19:46:20 +0000 |
17 | @@ -8,7 +8,7 @@ |
18 | |
19 | Page { |
20 | id: chooseTopicPage |
21 | - |
22 | + objectName: "choosetopicpage" |
23 | title: "Choose topic" |
24 | flickable: null |
25 | visible: false |
26 | @@ -101,6 +101,7 @@ |
27 | } |
28 | |
29 | delegate: ListItem.Standard { |
30 | + objectName: "topicItem" |
31 | text: model.tagName |
32 | |
33 | onClicked: { |
34 | |
35 | === modified file 'feeds/EditFeed.qml' |
36 | --- feeds/EditFeed.qml 2013-08-03 10:06:36 +0000 |
37 | +++ feeds/EditFeed.qml 2013-08-12 19:46:20 +0000 |
38 | @@ -8,7 +8,7 @@ |
39 | |
40 | Page { |
41 | id: editPage |
42 | - |
43 | + objectName: "editfeedpage" |
44 | title: i18n.tr("Edit Feed") |
45 | flickable: null/*content*/ |
46 | tools: ToolbarItems { |
47 | @@ -27,6 +27,7 @@ |
48 | Button |
49 | { |
50 | id: btnDelete |
51 | + objectName: "deleteButton" |
52 | text: i18n.tr("Delete") |
53 | gradient: UbuntuColors.orangeGradient |
54 | anchors.verticalCenter: parent.verticalCenter |
55 | |
56 | === modified file 'feeds/ManageFeedsPage.qml' |
57 | --- feeds/ManageFeedsPage.qml 2013-08-03 14:21:20 +0000 |
58 | +++ feeds/ManageFeedsPage.qml 2013-08-12 19:46:20 +0000 |
59 | @@ -8,6 +8,7 @@ |
60 | |
61 | Page { |
62 | id: editFeedsPageRoot |
63 | + objectName: "editfeedspage" |
64 | flickable: null |
65 | title: i18n.tr("Feeds") |
66 | |
67 | |
68 | === modified file 'feeds/TopicManagement.qml' |
69 | --- feeds/TopicManagement.qml 2013-08-03 10:06:36 +0000 |
70 | +++ feeds/TopicManagement.qml 2013-08-12 19:46:20 +0000 |
71 | @@ -7,6 +7,7 @@ |
72 | import "../databasemodule_v2.js" as DB |
73 | |
74 | Page { |
75 | + objectName: "topicmanagement" |
76 | id: topicManagement |
77 | |
78 | // width: units.gu(50) |
79 | @@ -69,6 +70,7 @@ |
80 | |
81 | Item { |
82 | id: itemAddTopic |
83 | + objectName: "addTopic" |
84 | anchors{ left: parent.left; right: parent.right } |
85 | height: units.gu(8) |
86 | |
87 | |
88 | === modified file 'listview/ArticleListPage.qml' |
89 | --- listview/ArticleListPage.qml 2013-07-29 18:31:05 +0000 |
90 | +++ listview/ArticleListPage.qml 2013-08-12 19:46:20 +0000 |
91 | @@ -8,7 +8,7 @@ |
92 | import "../databasemodule_v2.js" as DB |
93 | |
94 | Page { |
95 | - |
96 | + objectName: "articlelistpage" |
97 | signal articleSelected(var data) // mb id. |
98 | property var updateData: null |
99 | |
100 | |
101 | === modified file 'listview/FeedListPage.qml' |
102 | --- listview/FeedListPage.qml 2013-08-07 18:09:21 +0000 |
103 | +++ listview/FeedListPage.qml 2013-08-12 19:46:20 +0000 |
104 | @@ -10,7 +10,7 @@ |
105 | |
106 | Page { |
107 | id: pageItself |
108 | - |
109 | + objectName: "feedlistpage" |
110 | property var updatingFeed: null |
111 | property bool isDirty: false |
112 | |
113 | |
114 | === modified file 'tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py' |
115 | --- tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py 2013-08-03 17:15:11 +0000 |
116 | +++ tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py 2013-08-12 19:46:20 +0000 |
117 | @@ -30,9 +30,9 @@ |
118 | return self.app.select_single('QQuickListView', objectName = 'topiclist') |
119 | |
120 | def get_manage_topics_page(self): |
121 | - return self.app.select_single('ManageTopicsPage') |
122 | + return self.app.select_single('TopicManagement') |
123 | |
124 | - def get_canonical_topic(self): |
125 | + def get_canonical_topic_labelvisual(self): |
126 | itemList = self.app.select_many('LabelVisual', text = 'CanonicalTopic') |
127 | index = -1 |
128 | for item in itemList: |
129 | @@ -40,8 +40,13 @@ |
130 | if item.text == "CanonicalTopic": |
131 | return itemList[index] |
132 | |
133 | -## def get_canonical_feed_labelvisual(self): |
134 | -## return self.app.select_single('LabelVisual', text = 'Canonical') |
135 | + def get_canonical_topic_TopicComponent(self): |
136 | + itemList = self.app.select_many("TopicComponent", topicName= "CanonicalTopic") |
137 | + index = -1 |
138 | + for item in itemList: |
139 | + index +=1 |
140 | + if item.topicName == "CanonicalTopic": |
141 | + return itemList[index] |
142 | |
143 | def get_canonical_feed_labelvisual(self): |
144 | itemList = self.app.select_many('LabelVisual', text = 'Canonical') |
145 | @@ -60,5 +65,16 @@ |
146 | if item.text == "Canonical": |
147 | return itemList[index] |
148 | |
149 | + def get_canonical_feed_FeedComponent(self): |
150 | + return self.app.select_single("FeedComponent", text = "Canonical") |
151 | + |
152 | def get_header(self): |
153 | return self.app.select_many("Header") |
154 | + |
155 | + def get_all_feeds(self): |
156 | + return self.app.select_single('Subtitled', text = 'All articles') |
157 | + |
158 | + def get_add_a_topic(self): |
159 | + return self.app.select_single("QQuickItem", objectName = "addTopic") |
160 | + |
161 | + |
162 | |
163 | === modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py' |
164 | --- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-03 17:15:11 +0000 |
165 | +++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-12 19:46:20 +0000 |
166 | @@ -34,6 +34,106 @@ |
167 | |
168 | |
169 | def test_add_remove_feed_and_topic(self): |
170 | + """ test add and remove feed and topic""" |
171 | + |
172 | + #add topic and feed |
173 | + self._add_feed_and_topic() |
174 | + |
175 | + #remove added Canonical topic |
176 | +## self._remove_topic() |
177 | + |
178 | + #remove added Canonical feed |
179 | + self._remove_feed() |
180 | + |
181 | + |
182 | + def test_view_feeds(self): |
183 | + """test view feeds""" |
184 | + |
185 | + #verify we are on the Shorts page |
186 | + pageName = self.ubuntusdk.get_object("Tab", "Tab0") |
187 | + self.assertThat(pageName.title, Eventually(Equals("Shorts"))) |
188 | + |
189 | + #-----> view all news: |
190 | + #toggle toolbar |
191 | + self.ubuntusdk.toggle_toolbar() |
192 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
193 | + |
194 | + #click on add reads toolbar button |
195 | + self.ubuntusdk.click_toolbar_button('List view') |
196 | + |
197 | + #verify we are on the Feeds page |
198 | + feedlistpage = self.ubuntusdk.get_object("FeedListPage", "feedlistpage") |
199 | +## #self.assertThat(feedlistpage.title, Eventually(Equals("Feeds"))) |
200 | + self.assertThat(feedlistpage.title, Eventually(Equals(" "))) |
201 | + |
202 | + #select All articles |
203 | + allFeeds = self.main_window.get_all_feeds() |
204 | + self.assertThat(allFeeds, NotEquals("None")) |
205 | + self.pointing_device.click_object(allFeeds ) |
206 | + |
207 | + #verify we are on the All articles page |
208 | + articlelistpage = self.ubuntusdk.get_object("ArticleListPage", "articlelistpage") |
209 | + self.assertThat(articlelistpage.title, Eventually(Equals("All articles"))) |
210 | + |
211 | + #toggle toolbar |
212 | + self.ubuntusdk.toggle_toolbar() |
213 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
214 | + |
215 | + #click on back toolbar button |
216 | + self.ubuntusdk.click_toolbar_button('Back') |
217 | + |
218 | + #verify we are on the Feeds page |
219 | + feedlistpage = self.ubuntusdk.get_object("FeedListPage", "feedlistpage") |
220 | + self.assertThat(feedlistpage.title, Eventually(Equals("Feeds"))) |
221 | + |
222 | + #-----> view individual feed: |
223 | + #add topic and feed |
224 | + self._add_feed_and_topic() |
225 | + |
226 | + #select Canonical feed |
227 | + canonicalFeed = self.main_window.get_canonical_feed_labelvisual() |
228 | + self.assertThat(canonicalFeed, NotEquals(None)) |
229 | + self.pointing_device.click_object(canonicalFeed) |
230 | + |
231 | + #verify we are on the Canonical page |
232 | + header = self.main_window.get_header()[0] |
233 | + self.assertThat(header.title, Eventually(Equals("Canonical"))) |
234 | + |
235 | + #toggle toolbar |
236 | + self.ubuntusdk.toggle_toolbar() |
237 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
238 | + |
239 | + #click on back toolbar button |
240 | + self.ubuntusdk.click_toolbar_button('Back') |
241 | + |
242 | + #verify we are on the Feeds page |
243 | + feedlistpage = self.ubuntusdk.get_object("FeedListPage", "feedlistpage") |
244 | + self.assertThat(feedlistpage.title, Eventually(Equals("Feeds"))) |
245 | + |
246 | + #toggle toolbar |
247 | + self.ubuntusdk.toggle_toolbar() |
248 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
249 | + |
250 | + #click on back toolbar button |
251 | + self.ubuntusdk.click_toolbar_button('Shorts') |
252 | + |
253 | + #verify we are on the Shorts page |
254 | + pageName = self.ubuntusdk.get_object("Tab", "Tab0") |
255 | + self.assertThat(pageName.title, Eventually(Equals("Shorts"))) |
256 | + |
257 | + #remove added Canonical topic |
258 | + self._remove_topic() |
259 | + |
260 | + #remove added Canonical feed |
261 | + self._remove_feed() |
262 | + |
263 | + def _add_feed_and_topic(self): |
264 | + """test add feed and topic""" |
265 | + |
266 | + #verify we are on the Shorts page |
267 | + pageName = self.ubuntusdk.get_object("Tab", "Tab0") |
268 | + self.assertThat(pageName.title, Eventually(Equals("Shorts"))) |
269 | + |
270 | #toggle toolbar |
271 | self.ubuntusdk.toggle_toolbar() |
272 | |
273 | @@ -45,8 +145,8 @@ |
274 | self._run_action(addReadsPopover, '+ Add feeds') |
275 | |
276 | #verify Append Feed page is open |
277 | - header = self.main_window.get_header()[0] |
278 | - self.assertThat(header.title, Eventually(Equals("Append feed"))) |
279 | + appendpage = self.ubuntusdk.get_object("AppendFeedPage", "appendfeedpage") |
280 | + self.assertThat(appendpage.title, Eventually(Equals("Append feed"))) |
281 | |
282 | #type feed in input field |
283 | new_Feed_Url = self.main_window.get_append_feed_input_box() |
284 | @@ -55,8 +155,9 @@ |
285 | self.keyboard.type("http://www.canonical.com/rss.xml") |
286 | self.keyboard.type("\n") |
287 | self.assertThat(new_Feed_Url.text, Eventually(Equals("http://www.canonical.com/rss.xml"))) |
288 | - #---> TODO fix this |
289 | - sleep(1) |
290 | + #just for timing issue |
291 | + self.assertThat(appendpage.title, Eventually(Equals("Append feed"))) |
292 | + self.assertThat(self._canonical_feed, Eventually(Equals("http://www.canonical.com/rss.xml"))) |
293 | |
294 | #check that feed is updated, not empty |
295 | canonicalFeed = self.main_window.get_canonical_feed_labelvisual() |
296 | @@ -72,8 +173,9 @@ |
297 | nextButton = self.ubuntusdk.get_object("Button", "nextButton") |
298 | lambda: self.assertThat(nextButton, Eventually(NotEquals(None))) |
299 | self.pointing_device.click_object(nextButton) |
300 | - header = self.main_window.get_header()[0] |
301 | - self.assertThat(header.title, Eventually(Equals("Choose topic"))) |
302 | + |
303 | + chossetopicpage = self.ubuntusdk.get_object("ChooseTopicPage", "choosetopicpage") |
304 | + self.assertThat(chossetopicpage.title, Eventually(Equals("Choose topic"))) |
305 | |
306 | #add a new topic |
307 | new_Topic_Url = self.main_window.get_new_topic_input_box() |
308 | @@ -83,71 +185,124 @@ |
309 | self.keyboard.type("\n") |
310 | |
311 | #select canonical topic |
312 | - canonicalTopic = self.main_window.get_canonical_topic() |
313 | + canonicalTopic = self.main_window.get_canonical_topic_labelvisual() |
314 | self.assertThat(canonicalTopic, NotEquals(None)) |
315 | self.pointing_device.click_object(canonicalTopic) |
316 | - |
317 | - #remove added Canonical topic |
318 | - self._remove_topic() |
319 | - |
320 | - #check that it's gone |
321 | - canonicalTopic = self.main_window.get_canonical_topic() |
322 | - #---> TODO fix this |
323 | - sleep(1) |
324 | - self.assertThat(canonicalTopic.text, NotEquals("CanonicalTopic")) |
325 | - |
326 | - #remove added Canonical feed |
327 | - self._remove_feed() |
328 | + #just for timing purposes |
329 | + self.assertThat(canonicalTopic.text, Eventually(Equals("CanonicalTopic"))) |
330 | + |
331 | + #verify we are on the Shorts page |
332 | + pageName = self.ubuntusdk.get_object("Tab", "Tab0") |
333 | + self.assertThat(pageName.title, Eventually(Equals("Shorts"))) |
334 | |
335 | def _remove_feed(self): |
336 | + #verify we are on the Shorts page |
337 | + pageName = self.ubuntusdk.get_object("Tab", "Tab0") |
338 | + self.assertThat(pageName.title, Eventually(Equals("Shorts"))) |
339 | + |
340 | #toggle toolbar |
341 | self.ubuntusdk.toggle_toolbar() |
342 | - #click on back toolbar button |
343 | - header = self.main_window.get_header()[0] |
344 | - self.assertThat(header.title, Eventually(Equals("Topics"))) |
345 | - self.ubuntusdk.click_toolbar_button('Back') |
346 | - |
347 | - header = self.main_window.get_header()[0] |
348 | - self.assertThat(header.title, Eventually(Equals("Feeds"))) |
349 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
350 | + |
351 | + #click on back toolbar Button |
352 | + self.ubuntusdk.click_toolbar_button('Edit topics') |
353 | + |
354 | + #verify we are on the Management page |
355 | + feedlistpage = self.ubuntusdk.get_object("TopicManagement", "topicmanagement") |
356 | + self.assertThat(feedlistpage.title, Eventually(Equals("Management"))) |
357 | + self.assertThat(feedlistpage.visible, Eventually(Equals(True))) |
358 | + |
359 | + #select canonical topic |
360 | + canonicalTopic = self.main_window.get_canonical_topic_TopicComponent() |
361 | + self.assertThat(canonicalTopic, NotEquals(None)) |
362 | + self.pointing_device.click_object(canonicalTopic) |
363 | + if canonicalTopic.isExpended == False : |
364 | + self.pointing_device.click_object(canonicalTopic) |
365 | + self.assertThat(canonicalTopic.isExpended, Eventually(Equals(True))) |
366 | |
367 | #select canonical feed |
368 | - canonicalFeed = self.main_window.get_canonical_feed() |
369 | + canonicalFeed = self.main_window.get_canonical_feed_FeedComponent() |
370 | self.assertThat(canonicalFeed, NotEquals(None)) |
371 | - self.pointing_device.click_object(canonicalFeed, press_duration=2) |
372 | - |
373 | - #click on Remove popover action |
374 | - removeFeedPopover = self.main_window.get_action_popover() |
375 | - self._run_action(removeFeedPopover, 'Remove') |
376 | + |
377 | + self.pointing_device.click_object(canonicalFeed) |
378 | + |
379 | + #verify we are on the Edit Feed page |
380 | + editFeedPage = self.ubuntusdk.get_object("EditFeed", "editfeedpage") |
381 | + self.assertThat(editFeedPage.title, Eventually(Equals("Edit Feed"))) |
382 | + |
383 | + #toggle toolbar |
384 | + self.ubuntusdk.toggle_toolbar() |
385 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
386 | + |
387 | + #press delete button |
388 | + deleteButton = self.ubuntusdk.get_object("Button", "deleteButton") |
389 | + self.assertThat(deleteButton, NotEquals(None)) |
390 | + self.pointing_device.click_object(deleteButton) |
391 | + |
392 | + #verify we are on the Management page |
393 | + feedlistpage = self.ubuntusdk.get_object("TopicManagement", "topicmanagement") |
394 | + self.assertThat(feedlistpage.title, Eventually(Equals("Management"))) |
395 | + |
396 | + #select canonical topic |
397 | + canonicalTopic = self.main_window.get_canonical_topic_labelvisual() |
398 | + self.assertThat(canonicalTopic, NotEquals(None)) |
399 | + |
400 | + #check feed has been removed |
401 | + canonicalFeed = self.main_window.get_canonical_feed_FeedComponent() |
402 | + self.assertThat(canonicalFeed, Equals(None)) |
403 | |
404 | def _remove_topic(self): |
405 | + #verify we are on the Shorts page |
406 | + pageName = self.ubuntusdk.get_object("Tab", "Tab0") |
407 | + self.assertThat(pageName.title, Eventually(Equals("Shorts"))) |
408 | + |
409 | #toggle toolbar |
410 | self.ubuntusdk.toggle_toolbar() |
411 | + self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True))) |
412 | |
413 | #click on edit topics toolbar button |
414 | self.ubuntusdk.click_toolbar_button('Edit topics') |
415 | - header = self.main_window.get_header()[0] |
416 | - self.assertThat(header.title, Eventually(Equals("Feeds"))) |
417 | - |
418 | - self.ubuntusdk.click_toolbar_button('Topics') |
419 | - header = self.main_window.get_header()[0] |
420 | - self.assertThat(header.title, Eventually(Equals("Topics"))) |
421 | - |
422 | - #select and swipe canonical topic |
423 | - canonicalTopic = self.main_window.get_canonical_topic() |
424 | - self.assertThat(canonicalTopic, NotEquals(None)) |
425 | - |
426 | - qmlView = self.ubuntusdk.get_qml_view() |
427 | - topicsPage = self.main_window.get_manage_topics_page() |
428 | - |
429 | - #we have to consider the top tab offset, then create a swipe operation across the width of the page |
430 | - startX = int(topicsPage.x + topicsPage.width * 0.20) |
431 | - stopX = int(topicsPage.x + topicsPage.width * 0.80) |
432 | - tabHeightOffset = qmlView.height - topicsPage.height |
433 | - lineY = int(qmlView.y + canonicalTopic.y + tabHeightOffset) |
434 | - |
435 | - #swipe to remove the topic |
436 | - self.pointing_device.move(startX, lineY) |
437 | - self.pointing_device.drag(startX, lineY, stopX, lineY) |
438 | + |
439 | + #verify we are on the Topics page |
440 | + topicmanagement = self.ubuntusdk.get_object("TopicManagement", "topicmanagement") |
441 | + self.assertThat(topicmanagement.title, Eventually(Equals("Management"))) |
442 | + |
443 | + #select canonical topic |
444 | + canonicalTopic = self.main_window.get_canonical_topic() |
445 | + #self.assertThat(canonicalTopic, NotEquals(None)) |
446 | + self.assertThat(canonicalTopic.text, Equals("CanonicalTopic")) |
447 | + self.pointing_device.click_object(canonicalTopic) |
448 | + |
449 | + #verify Canonical feed is visible |
450 | + |
451 | + |
452 | + |
453 | +## qmlView = self.ubuntusdk.get_qml_view() |
454 | +## self.assertThat(qmlView, NotEquals(None)) |
455 | +## |
456 | +## topicsPage = self.main_window.get_manage_topics_page() |
457 | +## self.assertThat(topicsPage, NotEquals(None)) |
458 | +## |
459 | +## addATopicItem = self.main_window.get_add_a_topic() |
460 | +## self.assertThat(addATopic, NotEquals(None)) |
461 | +## |
462 | +## #we have to consider the top tab offset, then create a swipe operation across the width of the page |
463 | +## startX = int(topicsPage.x + topicsPage.width * 0.20) |
464 | +## stopX = int(topicsPage.x + topicsPage.width * 0.80) |
465 | +## tabHeightOffset = qmlView.height - topicsPage.height + addATopicItem.height |
466 | +## lineY = int(qmlView.y + canonicalTopic.y + tabHeightOffset) |
467 | +## |
468 | +## #swipe to remove the topic |
469 | +## self.pointing_device.move(startX, lineY) |
470 | +## self.pointing_device.drag(startX, lineY, stopX, lineY) |
471 | + |
472 | + |
473 | + |
474 | + |
475 | + #check that it's gone |
476 | + canonicalTopic = None |
477 | + canonicalTopic = self.main_window.get_canonical_topic() |
478 | + self.assertThat(canonicalTopic.visible, Equals(False)) |
479 | |
480 | def _run_action(self, popover, name): |
481 | actions = popover.select_many('Empty') |
482 | @@ -157,3 +312,9 @@ |
483 | requested = action |
484 | self.pointing_device.click_object(requested) |
485 | |
486 | + def _canonical_feed(self): |
487 | + try: |
488 | + return self.main_window.get_append_feed_input_box().text |
489 | + except StateNotFoundError: |
490 | + return None |
491 | + |
A quick glance at this, I don't see anything that jumps out at me. I'll do a better review tomorrow if it's not merged by then ;-)