Merge lp:~elopio/ubuntu-rssreader-app/refactor_tests into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
- refactor_tests
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 186 |
Merged at revision: | 187 |
Proposed branch: | lp:~elopio/ubuntu-rssreader-app/refactor_tests |
Merge into: | lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk |
Diff against target: |
414 lines (+169/-131) 3 files modified
feeds/AppendFeedPage.qml (+17/-1) tests/autopilot/shorts_app/emulators.py (+95/-6) tests/autopilot/shorts_app/tests/test_rssreader.py (+57/-124) |
To merge this branch: | bzr merge lp:~elopio/ubuntu-rssreader-app/refactor_tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Gagnon (community) | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Carla Sella (community) | Approve | ||
Leo Arias | Pending | ||
Review via email: mp+208517@code.launchpad.net |
Commit message
Cleaned a test to add a feed to a new topic.
Description of the change
I started refactoring the first test, but it includes an add and delete test. This branch only includes the add part. So, for now I'm not removing any old code or tests. I find it nicer to go slowly.
Please let me know what you think, and if we should continue writing the tests this way.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Chris Gagnon (chris.gagnon) wrote : | # |
I'd really like to see a local http started to serve rss files from 127.0.0.1 instead of an external website.
there is an example here you can re-use to serve an rss xml file.
https:/
Carla Sella (carla-sella) wrote : | # |
I think that writing tests this way is fine.
Carla Sella (carla-sella) : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:185
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:186
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Chris Gagnon (chris.gagnon) wrote : | # |
We should really mock the network calls, without looking too closely it looks like google provides a library to do this. https:/
I won't hold up this MP for not mocking the network, but it should be on the roadmap for autopilot tests in this project.
Preview Diff
1 | === modified file 'feeds/AppendFeedPage.qml' | |||
2 | --- feeds/AppendFeedPage.qml 2014-01-15 16:27:41 +0000 | |||
3 | +++ feeds/AppendFeedPage.qml 2014-03-04 04:12:43 +0000 | |||
4 | @@ -1,3 +1,19 @@ | |||
5 | 1 | /* | ||
6 | 2 | * Copyright (C) 2013, 2014 | ||
7 | 3 | * | ||
8 | 4 | * This program is free software; you can redistribute it and/or modify | ||
9 | 5 | * it under the terms of the GNU General Public License as published by | ||
10 | 6 | * the Free Software Foundation; version 3. | ||
11 | 7 | * | ||
12 | 8 | * This program is distributed in the hope that it will be useful, | ||
13 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | 11 | * GNU General Public License for more details. | ||
16 | 12 | * | ||
17 | 13 | * You should have received a copy of the GNU General Public License | ||
18 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | 15 | */ | ||
20 | 16 | |||
21 | 1 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
22 | 2 | import QtQuick.XmlListModel 2.0 | 18 | import QtQuick.XmlListModel 2.0 |
23 | 3 | import Ubuntu.Components 0.1 | 19 | import Ubuntu.Components 0.1 |
24 | @@ -249,7 +265,7 @@ | |||
25 | 249 | 265 | ||
26 | 250 | delegate: ListItem.Standard { | 266 | delegate: ListItem.Standard { |
27 | 251 | text: model.title | 267 | text: model.title |
29 | 252 | objectName: "feedpagelistitem" | 268 | objectName: "feedpagelistitem-" + model.title |
30 | 253 | 269 | ||
31 | 254 | control: CheckBox { | 270 | control: CheckBox { |
32 | 255 | anchors.verticalCenter: parent.verticalCenter | 271 | anchors.verticalCenter: parent.verticalCenter |
33 | 256 | 272 | ||
34 | === modified file 'tests/autopilot/shorts_app/emulators.py' | |||
35 | --- tests/autopilot/shorts_app/emulators.py 2014-01-15 16:27:41 +0000 | |||
36 | +++ tests/autopilot/shorts_app/emulators.py 2014-03-04 04:12:43 +0000 | |||
37 | @@ -1,6 +1,6 @@ | |||
38 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
39 | 2 | # | 2 | # |
41 | 3 | # Copyright (C) 2013 Canonical Ltd. | 3 | # Copyright (C) 2013, 2014 Canonical Ltd. |
42 | 4 | # | 4 | # |
43 | 5 | # This program is free software; you can redistribute it and/or modify | 5 | # This program is free software; you can redistribute it and/or modify |
44 | 6 | # it under the terms of the GNU Lesser General Public License as published by | 6 | # it under the terms of the GNU Lesser General Public License as published by |
45 | @@ -14,14 +14,41 @@ | |||
46 | 14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
47 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
48 | 16 | 16 | ||
49 | 17 | import logging | ||
50 | 18 | from time import sleep | ||
51 | 19 | |||
52 | 20 | from autopilot import logging as autopilot_logging | ||
53 | 21 | from testtools.matchers import NotEquals | ||
54 | 17 | from ubuntuuitoolkit import emulators as toolkit_emulators | 22 | from ubuntuuitoolkit import emulators as toolkit_emulators |
56 | 18 | from time import sleep | 23 | |
57 | 24 | |||
58 | 25 | logger = logging.getLogger(__name__) | ||
59 | 19 | 26 | ||
60 | 20 | 27 | ||
61 | 21 | class MainView(toolkit_emulators.MainView): | 28 | class MainView(toolkit_emulators.MainView): |
62 | 22 | 29 | ||
63 | 23 | retry_delay = 0.2 | 30 | retry_delay = 0.2 |
64 | 24 | 31 | ||
65 | 32 | @autopilot_logging.log_action(logger.info) | ||
66 | 33 | def go_to_add_feeds(self): | ||
67 | 34 | popover = self._click_add_reads() | ||
68 | 35 | popover.click_button_by_text('+ Add feeds') | ||
69 | 36 | return self.select_single( | ||
70 | 37 | AppendFeedPage, objectName='appendfeedpage') | ||
71 | 38 | |||
72 | 39 | def _click_add_reads(self): | ||
73 | 40 | toolbar = self.open_toolbar() | ||
74 | 41 | toolbar.click_button('addreadsbutton') | ||
75 | 42 | return self.get_action_selection_popover('addreadspopover') | ||
76 | 43 | |||
77 | 44 | def get_selected_tab_title(self): | ||
78 | 45 | tabs = self.get_tabs() | ||
79 | 46 | selected_tab_index = tabs.selectedTabIndex | ||
80 | 47 | # TODO there are other tabs that are not of TopicTab type. | ||
81 | 48 | # --elopio - 2014-02-26 | ||
82 | 49 | tab = tabs.select_single('TopicTab', index=selected_tab_index) | ||
83 | 50 | return tab.title | ||
84 | 51 | |||
85 | 25 | #ideally this should be converted to the sdk | 52 | #ideally this should be converted to the sdk |
86 | 26 | #and use object name not text names | 53 | #and use object name not text names |
87 | 27 | #see https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1205144 | 54 | #see https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1205144 |
88 | @@ -83,10 +110,6 @@ | |||
89 | 83 | #grab just the first checkbox | 110 | #grab just the first checkbox |
90 | 84 | return self.select_many_retry("CheckBox", objectName="feedCheckbox")[0] | 111 | return self.select_many_retry("CheckBox", objectName="feedCheckbox")[0] |
91 | 85 | 112 | ||
92 | 86 | def get_append_page_list_items(self): | ||
93 | 87 | return self.select_many_retry("Standard", | ||
94 | 88 | objectName="feedpagelistitem") | ||
95 | 89 | |||
96 | 90 | def get_next_button(self): | 113 | def get_next_button(self): |
97 | 91 | return self.select_single("Button", objectName="nextButton") | 114 | return self.select_single("Button", objectName="nextButton") |
98 | 92 | 115 | ||
99 | @@ -200,3 +223,69 @@ | |||
100 | 200 | def get_editfeed_valueselector_value(self, name): | 223 | def get_editfeed_valueselector_value(self, name): |
101 | 201 | valueselector = self.get_editfeed_topic_valueselector() | 224 | valueselector = self.get_editfeed_topic_valueselector() |
102 | 202 | return valueselector.select_single("LabelVisual", text=name) | 225 | return valueselector.select_single("LabelVisual", text=name) |
103 | 226 | |||
104 | 227 | |||
105 | 228 | class Page(toolkit_emulators.MainView): | ||
106 | 229 | """Autopilot helper for the Page objects.""" | ||
107 | 230 | |||
108 | 231 | def __init__(self, *args): | ||
109 | 232 | super(Page, self).__init__(*args) | ||
110 | 233 | # XXX we need a better way to keep reference to the main view. | ||
111 | 234 | # --elopio - 2014-02-26 | ||
112 | 235 | self.main_view = self.get_root_instance().select_single(MainView) | ||
113 | 236 | |||
114 | 237 | @autopilot_logging.log_action(logger.info) | ||
115 | 238 | def click_next(self): | ||
116 | 239 | toolbar = self.main_view.get_toolbar() | ||
117 | 240 | next_button = toolbar.select_single('Button', objectName='nextButton') | ||
118 | 241 | self.pointing_device.click_object(next_button) | ||
119 | 242 | |||
120 | 243 | |||
121 | 244 | class AppendFeedPage(Page): | ||
122 | 245 | """Autopilot helper for the Append Feed page.""" | ||
123 | 246 | |||
124 | 247 | @autopilot_logging.log_action(logger.info) | ||
125 | 248 | def search_feed(self, keyword_or_url): | ||
126 | 249 | search_text_field = self.select_single( | ||
127 | 250 | toolkit_emulators.TextField, objectName='tfFeedUrl') | ||
128 | 251 | # Write and press enter. | ||
129 | 252 | search_text_field.write(keyword_or_url + '\n') | ||
130 | 253 | self._wait_for_results_to_appear() | ||
131 | 254 | |||
132 | 255 | def _wait_for_results_to_appear(self): | ||
133 | 256 | results_list = self._get_results_list() | ||
134 | 257 | results_list.count.wait_for(NotEquals(0)) | ||
135 | 258 | |||
136 | 259 | def _get_results_list(self): | ||
137 | 260 | return self.select_single( | ||
138 | 261 | toolkit_emulators.QQuickListView, objectName='feedpagelistview') | ||
139 | 262 | |||
140 | 263 | @autopilot_logging.log_action(logger.info) | ||
141 | 264 | def select_results(self, *results): | ||
142 | 265 | """Select feed items from the list of results. | ||
143 | 266 | |||
144 | 267 | :param results: The titles of the items to select from the list. | ||
145 | 268 | |||
146 | 269 | """ | ||
147 | 270 | for result in results: | ||
148 | 271 | self._check_result(result) | ||
149 | 272 | |||
150 | 273 | def click_next(self): | ||
151 | 274 | super(AppendFeedPage, self).click_next() | ||
152 | 275 | return self.main_view.select_single( | ||
153 | 276 | ChooseTopicPage, objectName='choosetopicpage') | ||
154 | 277 | |||
155 | 278 | def _check_result(self, result): | ||
156 | 279 | results_list = self._get_results_list() | ||
157 | 280 | results_list.click_element('feedpagelistitem-{}'.format(result)) | ||
158 | 281 | |||
159 | 282 | |||
160 | 283 | class ChooseTopicPage(Page): | ||
161 | 284 | """Autopilot helper for the Choose Topic Page page.""" | ||
162 | 285 | |||
163 | 286 | @autopilot_logging.log_action(logger.info) | ||
164 | 287 | def add_topic(self, topic): | ||
165 | 288 | new_topic_text_field = self.select_single( | ||
166 | 289 | toolkit_emulators.TextField, objectName='newTopic') | ||
167 | 290 | # Write and press enter. | ||
168 | 291 | new_topic_text_field.write(topic + '\n') | ||
169 | 203 | 292 | ||
170 | === modified file 'tests/autopilot/shorts_app/tests/test_rssreader.py' | |||
171 | --- tests/autopilot/shorts_app/tests/test_rssreader.py 2014-02-13 03:52:29 +0000 | |||
172 | +++ tests/autopilot/shorts_app/tests/test_rssreader.py 2014-03-04 04:12:43 +0000 | |||
173 | @@ -1,9 +1,18 @@ | |||
174 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
180 | 2 | # Copyright 2013 Canonical | 2 | # |
181 | 3 | # | 3 | # Copyright (C) 2013, 2014 Canonical Ltd. |
182 | 4 | # This program is free software: you can redistribute it and/or modify it | 4 | # |
183 | 5 | # under the terms of the GNU General Public License version 3, as published | 5 | # This program is free software; you can redistribute it and/or modify |
184 | 6 | # by the Free Software Foundation. | 6 | # it under the terms of the GNU Lesser General Public License as published by |
185 | 7 | # the Free Software Foundation; version 3. | ||
186 | 8 | # | ||
187 | 9 | # This program is distributed in the hope that it will be useful, | ||
188 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
189 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
190 | 12 | # GNU Lesser General Public License for more details. | ||
191 | 13 | # | ||
192 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
193 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
194 | 7 | 16 | ||
195 | 8 | """shorts app autopilot tests.""" | 17 | """shorts app autopilot tests.""" |
196 | 9 | 18 | ||
197 | @@ -42,79 +51,28 @@ | |||
198 | 42 | self.main_view.get_network_activity, | 51 | self.main_view.get_network_activity, |
199 | 43 | Eventually(Equals(None), timeout=60)) | 52 | Eventually(Equals(None), timeout=60)) |
200 | 44 | 53 | ||
271 | 45 | def _add_feed_and_topic(self, feed, topicName): | 54 | def add_feed_to_new_topic(self, feed_url, feed_title, topic): |
272 | 46 | """test add feed and topic""" | 55 | add_feeds_page = self.main_view.go_to_add_feeds() |
273 | 47 | logger.debug("starting test add feed and topic") | 56 | # XXX here we are using an external server because we are currently |
274 | 48 | 57 | # using the Google Feed API, which doesn't let us access local | |
275 | 49 | self.assertThat(self.main_view.get_topics_page, | 58 | # resources. --elopio - 2014-02-26 |
276 | 50 | Eventually(NotEquals(None))) | 59 | add_feeds_page.search_feed(feed_url) |
277 | 51 | #open toolbar | 60 | add_feeds_page.select_results(feed_title) |
278 | 52 | logger.debug("opening toolbar") | 61 | choose_topics_page = add_feeds_page.click_next() |
279 | 53 | toolbar = self.main_view.open_toolbar() | 62 | choose_topics_page.add_topic(topic) |
280 | 54 | 63 | # TODO move this wait to the main view custom proxy object. | |
281 | 55 | #click on add reads toolbar button | 64 | # --elopio - 2014-02-26 |
212 | 56 | logger.debug("clicking addreadsbutton") | ||
213 | 57 | toolbar.click_button("addreadsbutton") | ||
214 | 58 | |||
215 | 59 | #click on add feeds popover action | ||
216 | 60 | logger.debug("clicking + Add feeds") | ||
217 | 61 | addReadsPopover = self.main_view.get_action_popover() | ||
218 | 62 | self.main_view.run_action(addReadsPopover, "+ Add feeds") | ||
219 | 63 | |||
220 | 64 | #verify Append Feed page is open | ||
221 | 65 | logger.debug("asserting append page") | ||
222 | 66 | appendpage = lambda: self.main_view.get_append_page().visible | ||
223 | 67 | self.assertThat(appendpage, Eventually(Equals(True))) | ||
224 | 68 | |||
225 | 69 | #type feed in input field | ||
226 | 70 | logger.debug("inputting feed") | ||
227 | 71 | self._input_new_feed(feed) | ||
228 | 72 | |||
229 | 73 | #click on checkbox to confirm feed | ||
230 | 74 | logger.debug("asserting checkbox") | ||
231 | 75 | self.assertThat(self.main_view.get_append_page_feed, | ||
232 | 76 | Eventually(Not(Is(None)))) | ||
233 | 77 | logger.debug("grabbing checkbox") | ||
234 | 78 | checkboxBtn = self.main_view.get_append_page_feed() | ||
235 | 79 | logger.debug("clicking checkbox") | ||
236 | 80 | self.pointing_device.click_object(checkboxBtn) | ||
237 | 81 | logger.debug("asserting checkbox checked") | ||
238 | 82 | self.assertThat(checkboxBtn.checked, Eventually(Equals(True))) | ||
239 | 83 | |||
240 | 84 | #save selected feedname | ||
241 | 85 | feedName = self.main_view.strip_html_tags( | ||
242 | 86 | str(self.main_view.get_append_page_list_items()[0].text)) | ||
243 | 87 | |||
244 | 88 | #click on Next button | ||
245 | 89 | logger.debug("asserting next") | ||
246 | 90 | self.assertThat(self.main_view.get_next_button, | ||
247 | 91 | Eventually(Not(Is(None)))) | ||
248 | 92 | logger.debug("grabbing next") | ||
249 | 93 | nextButton = self.main_view.get_next_button() | ||
250 | 94 | logger.debug("clicking next") | ||
251 | 95 | self.pointing_device.click_object(nextButton) | ||
252 | 96 | |||
253 | 97 | #verify choose topic page has opened | ||
254 | 98 | logger.debug("asserting choose topic page") | ||
255 | 99 | chossetopicpage = lambda: self.main_view.get_topics_page().visible | ||
256 | 100 | self.assertThat(chossetopicpage, Eventually(Equals(True))) | ||
257 | 101 | |||
258 | 102 | #get current topics | ||
259 | 103 | logger.debug("grabbing topics") | ||
260 | 104 | topics = self.main_view.get_choose_topics_items() | ||
261 | 105 | numTopics = len(topics) | ||
262 | 106 | logger.debug("found " + str(numTopics) + " topics") | ||
263 | 107 | for topic in topics: | ||
264 | 108 | logger.debug("Topic: " + str(topic.text)) | ||
265 | 109 | |||
266 | 110 | #add a new topic | ||
267 | 111 | logger.debug("input topic") | ||
268 | 112 | self._input_new_topic(topicName) | ||
269 | 113 | |||
270 | 114 | #wait for new feed and topic to be added | ||
282 | 115 | self._wait_for_refresh() | 65 | self._wait_for_refresh() |
283 | 116 | 66 | ||
285 | 117 | return feedName | 67 | def test_add_feed_to_new_topic(self): |
286 | 68 | """Test that adding a feed to a new topic must show it in a new tab.""" | ||
287 | 69 | test_feed_url = 'http://www.canonical.com/rss.xml' | ||
288 | 70 | test_feed_title = 'Insights' | ||
289 | 71 | test_topic = 'Test topic' | ||
290 | 72 | self.add_feed_to_new_topic(test_feed_url, test_feed_title, test_topic) | ||
291 | 73 | |||
292 | 74 | selected_tab_title = self.main_view.get_selected_tab_title() | ||
293 | 75 | self.assertEqual('Test topic', selected_tab_title) | ||
294 | 118 | 76 | ||
295 | 119 | def _remove_feed(self, feedName, topicName): | 77 | def _remove_feed(self, feedName, topicName): |
296 | 120 | logger.debug("removing feed") | 78 | logger.debug("removing feed") |
297 | @@ -268,55 +226,32 @@ | |||
298 | 268 | poll += 1 | 226 | poll += 1 |
299 | 269 | return topic | 227 | return topic |
300 | 270 | 228 | ||
302 | 271 | def test_add_remove_feed_and_topic(self): | 229 | def test_remove_feed_and_topic(self): |
303 | 272 | """ test add and remove feed and topic""" | 230 | """ test add and remove feed and topic""" |
321 | 273 | 231 | test_feed_url = 'http://www.canonical.com/rss.xml' | |
322 | 274 | #add topic and feed | 232 | test_feed_title = 'Insights' |
323 | 275 | #TODO, try several different feeds | 233 | test_topic = 'Test topic' |
324 | 276 | feed = "http://www.canonical.com/rss.xml" | 234 | self.add_feed_to_new_topic(test_feed_url, test_feed_title, test_topic) |
308 | 277 | feedName = "Insights" | ||
309 | 278 | topicName = "CanonicalTopic" | ||
310 | 279 | |||
311 | 280 | #just for timing issues | ||
312 | 281 | self.assertThat(self.main_view.get_shorts_tab(), | ||
313 | 282 | NotEquals(None)) | ||
314 | 283 | self.assertThat(self.main_view.get_shorts_tab().objectName, | ||
315 | 284 | Eventually(Equals("Tab0"))) | ||
316 | 285 | self.assertThat(self.main_view.get_shorts_tab().visible, | ||
317 | 286 | Eventually(Equals(True))) | ||
318 | 287 | |||
319 | 288 | #add feed and topic | ||
320 | 289 | feedName = self._add_feed_and_topic(feed, topicName) | ||
325 | 290 | 235 | ||
326 | 291 | #remove added feed | 236 | #remove added feed |
327 | 292 | logger.debug("starting remove feed") | 237 | logger.debug("starting remove feed") |
328 | 293 | 238 | ||
330 | 294 | self._remove_feed(feedName, topicName) | 239 | self._remove_feed(test_feed_title, test_topic) |
331 | 295 | 240 | ||
332 | 296 | #remove added topic | 241 | #remove added topic |
334 | 297 | self._remove_topic(topicName) | 242 | self._remove_topic(test_topic) |
335 | 298 | 243 | ||
336 | 299 | @unittest.skip("Tab switching fails") | 244 | @unittest.skip("Tab switching fails") |
337 | 300 | def test_view_mode_and_feed_item(self): | 245 | def test_view_mode_and_feed_item(self): |
338 | 301 | """test view modes and ensure feed items can be opened""" | 246 | """test view modes and ensure feed items can be opened""" |
354 | 302 | 247 | test_feed_url = 'http://www.canonical.com/rss.xml' | |
355 | 303 | feed = "http://www.canonical.com/rss.xml" | 248 | test_feed_title = 'Insights' |
356 | 304 | #feedName = "Insights" | 249 | test_topic = 'Test topic' |
357 | 305 | topicName = "CanonicalTopic" | 250 | |
358 | 306 | 251 | self.add_feed_to_new_topic(test_feed_url, test_feed_title, test_topic) | |
344 | 307 | #just for timing issues | ||
345 | 308 | self.assertThat(self.main_view.get_shorts_tab(), | ||
346 | 309 | NotEquals(None)) | ||
347 | 310 | self.assertThat(self.main_view.get_shorts_tab().objectName, | ||
348 | 311 | Eventually(Equals("Tab0"))) | ||
349 | 312 | self.assertThat(self.main_view.get_shorts_tab().visible, | ||
350 | 313 | Eventually(Equals(True))) | ||
351 | 314 | |||
352 | 315 | #add topic and feed | ||
353 | 316 | self._add_feed_and_topic(feed, topicName) | ||
359 | 317 | 252 | ||
360 | 318 | #verify we are on the editTopic Tab | 253 | #verify we are on the editTopic Tab |
362 | 319 | editTab = self.main_view.get_topic_tab(topicName) | 254 | editTab = self.main_view.get_topic_tab(test_topic) |
363 | 320 | self.assertThat(lambda: editTab.visible, Eventually(Equals(True))) | 255 | self.assertThat(lambda: editTab.visible, Eventually(Equals(True))) |
364 | 321 | 256 | ||
365 | 322 | #open toolbar | 257 | #open toolbar |
366 | @@ -344,9 +279,9 @@ | |||
367 | 344 | #self.assertThat(lambda: feedTab.visible, Eventually(Equals(True))) | 279 | #self.assertThat(lambda: feedTab.visible, Eventually(Equals(True))) |
368 | 345 | 280 | ||
369 | 346 | #select feed entry | 281 | #select feed entry |
371 | 347 | self.assertThat(lambda: self.main_view.get_feedlist(topicName), | 282 | self.assertThat(lambda: self.main_view.get_feedlist(test_topic), |
372 | 348 | Eventually(Not(Is(None)))) | 283 | Eventually(Not(Is(None)))) |
374 | 349 | editFeed = self.main_view.get_feedlist(topicName) | 284 | editFeed = self.main_view.get_feedlist(test_topic) |
375 | 350 | 285 | ||
376 | 351 | for item in editFeed: | 286 | for item in editFeed: |
377 | 352 | label = item.select_single("Label", objectName="labelFeedname") | 287 | label = item.select_single("Label", objectName="labelFeedname") |
378 | @@ -362,16 +297,14 @@ | |||
379 | 362 | @unittest.skip("Can't see or get dynamic tabs") | 297 | @unittest.skip("Can't see or get dynamic tabs") |
380 | 363 | def test_edit_topic(self): | 298 | def test_edit_topic(self): |
381 | 364 | """test edit topic""" | 299 | """test edit topic""" |
389 | 365 | 300 | test_feed_url = 'http://www.canonical.com/rss.xml' | |
390 | 366 | feed = "http://www.canonical.com/rss.xml" | 301 | test_feed_title = 'Insights' |
391 | 367 | feedName = "Insights" | 302 | test_topic = 'Test topic' |
392 | 368 | topicName = "CanonicalTopic" | 303 | |
393 | 369 | 304 | self.add_feed_to_new_topic(test_feed_url, test_feed_title, test_topic) | |
387 | 370 | #add topic and feed | ||
388 | 371 | feedName = self._add_feed_and_topic(feed, topicName) | ||
394 | 372 | 305 | ||
395 | 373 | #verify we are on the topicName Tab | 306 | #verify we are on the topicName Tab |
397 | 374 | editTab = self.main_view.get_topic_tab(topicName) | 307 | editTab = self.main_view.get_topic_tab(test_topic) |
398 | 375 | self.assertThat(editTab.visible, Eventually(Equals(True))) | 308 | self.assertThat(editTab.visible, Eventually(Equals(True))) |
399 | 376 | 309 | ||
400 | 377 | #open toolbar | 310 | #open toolbar |
401 | @@ -387,12 +320,12 @@ | |||
402 | 387 | Eventually(Equals("topicmanagement"))) | 320 | Eventually(Equals("topicmanagement"))) |
403 | 388 | 321 | ||
404 | 389 | #verity Tab is expanded | 322 | #verity Tab is expanded |
406 | 390 | editTopic = self.main_view.get_feedlist_topic(topicName) | 323 | editTopic = self.main_view.get_feedlist_topic(test_topic) |
407 | 391 | if editTopic.state != "expended": | 324 | if editTopic.state != "expended": |
408 | 392 | self.pointing_device.click_object(editTopic) | 325 | self.pointing_device.click_object(editTopic) |
409 | 393 | 326 | ||
410 | 394 | #select feed | 327 | #select feed |
412 | 395 | editFeed = self.main_view.get_feedlist_feed(feedName) | 328 | editFeed = self.main_view.get_feedlist_feed(test_topic) |
413 | 396 | self.assertThat(editFeed, NotEquals(None)) | 329 | self.assertThat(editFeed, NotEquals(None)) |
414 | 397 | self.pointing_device.click_object(editFeed) | 330 | self.pointing_device.click_object(editFeed) |
415 | 398 | 331 |
FAILED: Continuous integration, rev:184 91.189. 93.70:8080/ job/ubuntu- rssreader- app-ci/ 184/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 1524 91.189. 93.70:8080/ job/ubuntu- rssreader- app-raring- amd64-ci/ 184 91.189. 93.70:8080/ job/ubuntu- rssreader- app-saucy- amd64-ci/ 184 91.189. 93.70:8080/ job/ubuntu- rssreader- app-trusty- amd64-ci/ 71
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- rssreader- app-ci/ 184/rebuild
http://