Merge lp:~nskaggs/ubuntu-rssreader-app/fix-my-horrible-prints into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
- fix-my-horrible-prints
- Merge into trunk
Proposed by
Nicholas Skaggs
Status: | Merged |
---|---|
Approved by: | Joey Chan |
Approved revision: | 75 |
Merged at revision: | 77 |
Proposed branch: | lp:~nskaggs/ubuntu-rssreader-app/fix-my-horrible-prints |
Merge into: | lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk |
Diff against target: |
274 lines (+60/-50) 2 files modified
tests/autopilot/ubuntu_rssreader_app/tests/__init__.py (+8/-2) tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+52/-48) |
To merge this branch: | bzr merge lp:~nskaggs/ubuntu-rssreader-app/fix-my-horrible-prints |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Ubuntu Shorts Developers | Pending | ||
Review via email: mp+188079@code.launchpad.net |
Commit message
Add support for testing via click packages
Description of the change
Add support for testing via click packages
fix my horrible print statements
To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
review:
Needs Fixing
(continuous-integration)
- 75. By Nicholas Skaggs
-
fix logger issues
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:75
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'tests/autopilot/ubuntu_rssreader_app/tests/__init__.py' | |||
2 | --- tests/autopilot/ubuntu_rssreader_app/tests/__init__.py 2013-09-26 08:44:17 +0000 | |||
3 | +++ tests/autopilot/ubuntu_rssreader_app/tests/__init__.py 2013-09-27 16:22:38 +0000 | |||
4 | @@ -44,6 +44,8 @@ | |||
5 | 44 | scenarios = [('with touch', dict(input_device_class=Touch))] | 44 | scenarios = [('with touch', dict(input_device_class=Touch))] |
6 | 45 | 45 | ||
7 | 46 | local_location = "../../rssreader-app.qml" | 46 | local_location = "../../rssreader-app.qml" |
8 | 47 | installed_location = "/usr/share/rssreader-app/rssreader-app.qml" | ||
9 | 48 | |||
10 | 47 | sqlite_dir = os.path.expanduser( | 49 | sqlite_dir = os.path.expanduser( |
11 | 48 | "~/.local/share/Qt Project/QtQmlViewer/QML/OfflineStorage/Databases") | 50 | "~/.local/share/Qt Project/QtQmlViewer/QML/OfflineStorage/Databases") |
12 | 49 | backup_dir = sqlite_dir + ".backup" | 51 | backup_dir = sqlite_dir + ".backup" |
13 | @@ -62,8 +64,10 @@ | |||
14 | 62 | 64 | ||
15 | 63 | if os.path.exists(self.local_location): | 65 | if os.path.exists(self.local_location): |
16 | 64 | self.launch_test_local() | 66 | self.launch_test_local() |
18 | 65 | else: | 67 | elif os.path.exists(self.installed_location): |
19 | 66 | self.launch_test_installed() | 68 | self.launch_test_installed() |
20 | 69 | else: | ||
21 | 70 | self.launch_test_click() | ||
22 | 67 | 71 | ||
23 | 68 | def launch_test_local(self): | 72 | def launch_test_local(self): |
24 | 69 | self.app = self.launch_test_application( | 73 | self.app = self.launch_test_application( |
25 | @@ -75,11 +79,13 @@ | |||
26 | 75 | def launch_test_installed(self): | 79 | def launch_test_installed(self): |
27 | 76 | self.app = self.launch_test_application( | 80 | self.app = self.launch_test_application( |
28 | 77 | "qmlscene", | 81 | "qmlscene", |
30 | 78 | "/usr/share/rssreader-app/rssreader-app.qml", | 82 | self.installed_location, |
31 | 79 | "--desktop_file_hint=/usr/share/applications/" | 83 | "--desktop_file_hint=/usr/share/applications/" |
32 | 80 | "rssreader-app.desktop", | 84 | "rssreader-app.desktop", |
33 | 81 | app_type='qt', | 85 | app_type='qt', |
34 | 82 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | 86 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
35 | 87 | def launch_test_click(self): | ||
36 | 88 | self.app = self.launch_click_package("com.ubuntu.rssreader-app", emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | ||
37 | 83 | 89 | ||
38 | 84 | def temp_move_sqlite_db(self): | 90 | def temp_move_sqlite_db(self): |
39 | 85 | if os.path.exists(self.backup_dir): | 91 | if os.path.exists(self.backup_dir): |
40 | 86 | 92 | ||
41 | === modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py' | |||
42 | --- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-09-11 18:43:33 +0000 | |||
43 | +++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-09-27 16:22:38 +0000 | |||
44 | @@ -17,11 +17,15 @@ | |||
45 | 17 | 17 | ||
46 | 18 | from autopilot.introspection.dbus import StateNotFoundError | 18 | from autopilot.introspection.dbus import StateNotFoundError |
47 | 19 | from ubuntu_rssreader_app.tests import RssReaderAppTestCase | 19 | from ubuntu_rssreader_app.tests import RssReaderAppTestCase |
48 | 20 | import logging | ||
49 | 20 | 21 | ||
50 | 21 | from time import sleep | 22 | from time import sleep |
51 | 22 | 23 | ||
52 | 23 | class TestMainWindow(RssReaderAppTestCase): | 24 | class TestMainWindow(RssReaderAppTestCase): |
53 | 24 | 25 | ||
54 | 26 | global logger | ||
55 | 27 | logger = logging.getLogger(__name__) | ||
56 | 28 | |||
57 | 25 | def setUp(self): | 29 | def setUp(self): |
58 | 26 | super(TestMainWindow, self).setUp() | 30 | super(TestMainWindow, self).setUp() |
59 | 27 | 31 | ||
60 | @@ -33,142 +37,142 @@ | |||
61 | 33 | 37 | ||
62 | 34 | def _add_feed_and_topic(self, feed, topicName): | 38 | def _add_feed_and_topic(self, feed, topicName): |
63 | 35 | """test add feed and topic""" | 39 | """test add feed and topic""" |
65 | 36 | print "starting test add feed and topic" | 40 | logger.debug("starting test add feed and topic") |
66 | 37 | #open toolbar | 41 | #open toolbar |
68 | 38 | print "opening toolbar" | 42 | logger.debug("opening toolbar") |
69 | 39 | toolbar = self.main_view.open_toolbar() | 43 | toolbar = self.main_view.open_toolbar() |
70 | 40 | 44 | ||
71 | 41 | #click on add reads toolbar button | 45 | #click on add reads toolbar button |
73 | 42 | print "clicking addreadsbutton" | 46 | logger.debug("clicking addreadsbutton") |
74 | 43 | toolbar.click_button("addreadsbutton") | 47 | toolbar.click_button("addreadsbutton") |
75 | 44 | 48 | ||
76 | 45 | #click on add feeds popover action | 49 | #click on add feeds popover action |
78 | 46 | print "clicking + Add feeds" | 50 | logger.debug("clicking + Add feeds") |
79 | 47 | addReadsPopover = self.main_view.get_action_popover() | 51 | addReadsPopover = self.main_view.get_action_popover() |
80 | 48 | self.main_view.run_action(addReadsPopover, "+ Add feeds") | 52 | self.main_view.run_action(addReadsPopover, "+ Add feeds") |
81 | 49 | 53 | ||
82 | 50 | #verify Append Feed page is open | 54 | #verify Append Feed page is open |
84 | 51 | print "asserting append page" | 55 | logger.debug("asserting append page") |
85 | 52 | appendpage = lambda: self.main_view.get_append_page().visible | 56 | appendpage = lambda: self.main_view.get_append_page().visible |
86 | 53 | self.assertThat(appendpage, Eventually(Equals(True))) | 57 | self.assertThat(appendpage, Eventually(Equals(True))) |
87 | 54 | 58 | ||
88 | 55 | #type feed in input field | 59 | #type feed in input field |
90 | 56 | print "inputting feed" | 60 | logger.debug("inputting feed") |
91 | 57 | self._input_new_feed(feed) | 61 | self._input_new_feed(feed) |
92 | 58 | 62 | ||
93 | 59 | #click on checkbox to confirm feed | 63 | #click on checkbox to confirm feed |
95 | 60 | print "asserting checkbox" | 64 | logger.debug("asserting checkbox") |
96 | 61 | self.assertThat(self.main_view.get_append_page_feed, Eventually(Not(Is(None)))) | 65 | self.assertThat(self.main_view.get_append_page_feed, Eventually(Not(Is(None)))) |
98 | 62 | print "grabbing checkbox" | 66 | logger.debug("grabbing checkbox") |
99 | 63 | checkboxBtn = self.main_view.get_append_page_feed() | 67 | checkboxBtn = self.main_view.get_append_page_feed() |
101 | 64 | print "clicking checkbox" | 68 | logger.debug("clicking checkbox") |
102 | 65 | self.pointing_device.click_object(checkboxBtn) | 69 | self.pointing_device.click_object(checkboxBtn) |
104 | 66 | print "asserting checkbox checked" | 70 | logger.debug("asserting checkbox checked") |
105 | 67 | self.assertThat(checkboxBtn.checked, Eventually(Equals(True))) | 71 | self.assertThat(checkboxBtn.checked, Eventually(Equals(True))) |
106 | 68 | 72 | ||
107 | 69 | #click on Next button | 73 | #click on Next button |
109 | 70 | print "asserting next" | 74 | logger.debug("asserting next") |
110 | 71 | self.assertThat(self.main_view.get_next_button, Eventually(Not(Is(None)))) | 75 | self.assertThat(self.main_view.get_next_button, Eventually(Not(Is(None)))) |
112 | 72 | print "grabbing next" | 76 | logger.debug("grabbing next") |
113 | 73 | nextButton = self.main_view.get_next_button() | 77 | nextButton = self.main_view.get_next_button() |
115 | 74 | print "clicking next" | 78 | logger.debug("clicking next") |
116 | 75 | self.pointing_device.click_object(nextButton) | 79 | self.pointing_device.click_object(nextButton) |
117 | 76 | 80 | ||
118 | 77 | #verify choose topic page has opened | 81 | #verify choose topic page has opened |
120 | 78 | print "asserting choose topic page" | 82 | logger.debug("asserting choose topic page") |
121 | 79 | chossetopicpage = lambda: self.main_view.get_topics_page().visible | 83 | chossetopicpage = lambda: self.main_view.get_topics_page().visible |
122 | 80 | self.assertThat(chossetopicpage, Eventually(Equals(True))) | 84 | self.assertThat(chossetopicpage, Eventually(Equals(True))) |
123 | 81 | 85 | ||
124 | 82 | #get current topics | 86 | #get current topics |
126 | 83 | print "grabbing topics" | 87 | logger.debug("grabbing topics") |
127 | 84 | topics = self.main_view.get_choose_topics_items() | 88 | topics = self.main_view.get_choose_topics_items() |
128 | 85 | numTopics = len(topics) | 89 | numTopics = len(topics) |
130 | 86 | print "found " + str(numTopics) + " topics" | 90 | logger.debug("found " + str(numTopics) + " topics") |
131 | 87 | for topic in topics: | 91 | for topic in topics: |
133 | 88 | print "Topic: " + str(topic.text) | 92 | logger.debug("Topic: " + str(topic.text)) |
134 | 89 | 93 | ||
135 | 90 | #add a new topic | 94 | #add a new topic |
137 | 91 | print "input topic" | 95 | logger.debug("input topic") |
138 | 92 | self._input_new_topic(topicName) | 96 | self._input_new_topic(topicName) |
139 | 93 | 97 | ||
140 | 94 | #A new topic is now automatically selected as the topic | 98 | #A new topic is now automatically selected as the topic |
141 | 95 | #select new topic | 99 | #select new topic |
143 | 96 | #print "assert new topic" | 100 | #logger.debug("assert new topic") |
144 | 97 | #newNumTopics = len(self.main_view.get_choose_topics_items) | 101 | #newNumTopics = len(self.main_view.get_choose_topics_items) |
145 | 98 | #self.assertThat(newNumTopics, Eventually(Equals(numTopics + 1))) | 102 | #self.assertThat(newNumTopics, Eventually(Equals(numTopics + 1))) |
147 | 99 | #print "grab new topic" | 103 | #logger.debug("grab new topic") |
148 | 100 | #topics = self.main_view.get_choose_topics_items() | 104 | #topics = self.main_view.get_choose_topics_items() |
149 | 101 | #numTopics = len(topics) | 105 | #numTopics = len(topics) |
151 | 102 | #print "found " + str(numTopics) + " topics" | 106 | #logger.debug("found " + str(numTopics) + " topics") |
152 | 103 | #for topic in topics: | 107 | #for topic in topics: |
154 | 104 | # print "Topic: " + str(topic.text) | 108 | # logger.debug("Topic: ") + str(topic.text) |
155 | 105 | #newTopic = self.main_view.get_choose_topics_items()[-1] | 109 | #newTopic = self.main_view.get_choose_topics_items()[-1] |
156 | 106 | #newTopic = topics[-1] | 110 | #newTopic = topics[-1] |
158 | 107 | #print "click new topic, " + str(newTopic.text) | 111 | #logger.debug("click new topic, ") + str(newTopic.text) |
159 | 108 | #self.pointing_device.click_object(newTopic) | 112 | #self.pointing_device.click_object(newTopic) |
161 | 109 | #print "topic clicked" | 113 | #logger.debug("topic clicked") |
162 | 110 | 114 | ||
163 | 111 | #wait for any updates to finish before beginning tests | 115 | #wait for any updates to finish before beginning tests |
164 | 112 | #this transition currently locks the device https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1221893 | 116 | #this transition currently locks the device https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1221893 |
166 | 113 | #print "check for network updates" | 117 | #logger.debug("check for network updates") |
167 | 114 | #self.assertThat(self.main_view.get_network_activity, Eventually(Not(Is(None)))) | 118 | #self.assertThat(self.main_view.get_network_activity, Eventually(Not(Is(None)))) |
169 | 115 | #print "assert no network updates" | 119 | #logger.debug("assert no network updates") |
170 | 116 | #self.assertThat(self.main_view.get_network_activity, Eventually(Is(None))) | 120 | #self.assertThat(self.main_view.get_network_activity, Eventually(Is(None))) |
172 | 117 | #print "assert we're back on main view" | 121 | #logger.debug("assert we're back on main view") |
173 | 118 | #self.assertThat(self.main_view.visible, Eventually(Equals(True))) | 122 | #self.assertThat(self.main_view.visible, Eventually(Equals(True))) |
175 | 119 | #print "finished with add_feed_topic" | 123 | #logger.debug("finished with add_feed_topic") |
176 | 120 | 124 | ||
177 | 121 | def _remove_feed(self, feedName, topicName): | 125 | def _remove_feed(self, feedName, topicName): |
179 | 122 | print "removing feed" | 126 | logger.debug("removing feed") |
180 | 123 | #open toolbar | 127 | #open toolbar |
182 | 124 | print "opening toolbar" | 128 | logger.debug("opening toolbar") |
183 | 125 | toolbar = self.main_view.open_toolbar() | 129 | toolbar = self.main_view.open_toolbar() |
184 | 126 | 130 | ||
185 | 127 | #click on back toolbar Button | 131 | #click on back toolbar Button |
187 | 128 | print "clicking edit topics" | 132 | logger.debug("clicking edit topics") |
188 | 129 | toolbar.click_button("edittopicsbutton") | 133 | toolbar.click_button("edittopicsbutton") |
189 | 130 | 134 | ||
190 | 131 | #verify we are on the Management page | 135 | #verify we are on the Management page |
192 | 132 | print "assert feedlist page" | 136 | logger.debug("assert feedlist page") |
193 | 133 | feedlistpage = lambda: self.main_view.get_feed_management_page().visible | 137 | feedlistpage = lambda: self.main_view.get_feed_management_page().visible |
194 | 134 | self.assertThat(feedlistpage, Eventually(Equals(True))) | 138 | self.assertThat(feedlistpage, Eventually(Equals(True))) |
195 | 135 | 139 | ||
196 | 136 | #select topic | 140 | #select topic |
198 | 137 | print "grabbing topic" | 141 | logger.debug("grabbing topic") |
199 | 138 | self._get_topic(topicName) | 142 | self._get_topic(topicName) |
200 | 139 | 143 | ||
201 | 140 | #select feed | 144 | #select feed |
203 | 141 | print "assert feed" | 145 | logger.debug("assert feed") |
204 | 142 | self.assertThat(lambda: self.main_view.get_feedlist_feed(feedName), Eventually(Not(Is(None)))) | 146 | self.assertThat(lambda: self.main_view.get_feedlist_feed(feedName), Eventually(Not(Is(None)))) |
206 | 143 | print "grabbing feed" | 147 | logger.debug("grabbing feed") |
207 | 144 | feed = self.main_view.get_feedlist_feed(feedName) | 148 | feed = self.main_view.get_feedlist_feed(feedName) |
209 | 145 | print "clicking feed" | 149 | logger.debug("clicking feed") |
210 | 146 | self.pointing_device.click_object(feed) | 150 | self.pointing_device.click_object(feed) |
211 | 147 | 151 | ||
212 | 148 | #verify we are on the Edit Feed page | 152 | #verify we are on the Edit Feed page |
214 | 149 | print "assert editfeedpage" | 153 | logger.debug("assert editfeedpage") |
215 | 150 | editFeedPage = self.main_view.get_edit_feed_page() | 154 | editFeedPage = self.main_view.get_edit_feed_page() |
216 | 151 | self.assertThat(editFeedPage.visible, Eventually(Equals(True))) | 155 | self.assertThat(editFeedPage.visible, Eventually(Equals(True))) |
217 | 152 | 156 | ||
218 | 153 | #press delete button | 157 | #press delete button |
220 | 154 | print "assert delete button" | 158 | logger.debug("assert delete button") |
221 | 155 | self.assertThat(self.main_view.get_delete_button, Eventually(Not(Is(None)))) | 159 | self.assertThat(self.main_view.get_delete_button, Eventually(Not(Is(None)))) |
223 | 156 | print "grab delete button" | 160 | logger.debug("grab delete button") |
224 | 157 | deleteButton = self.main_view.get_delete_button() | 161 | deleteButton = self.main_view.get_delete_button() |
226 | 158 | print "click delete button" | 162 | logger.debug("click delete button") |
227 | 159 | self.pointing_device.click_object(deleteButton) | 163 | self.pointing_device.click_object(deleteButton) |
228 | 160 | 164 | ||
229 | 161 | #verify we are on the Management page | 165 | #verify we are on the Management page |
231 | 162 | print "assert feedlistpage" | 166 | logger.debug("assert feedlistpage") |
232 | 163 | feedlistpage = lambda: self.main_view.get_feed_management_page().visible | 167 | feedlistpage = lambda: self.main_view.get_feed_management_page().visible |
233 | 164 | self.assertThat(feedlistpage, Eventually(Equals(True))) | 168 | self.assertThat(feedlistpage, Eventually(Equals(True))) |
234 | 165 | 169 | ||
235 | 166 | #check topic | 170 | #check topic |
237 | 167 | print "assert topic remains" | 171 | logger.debug("assert topic remains") |
238 | 168 | self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName), Eventually(Not(Is(None)))) | 172 | self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName), Eventually(Not(Is(None)))) |
239 | 169 | 173 | ||
240 | 170 | #check feed has been removed | 174 | #check feed has been removed |
242 | 171 | print "assert removed feed" | 175 | logger.debug("assert removed feed") |
243 | 172 | self.assertThat(lambda: self.main_view.get_feedlist_feed(feedName), Eventually(Equals(None))) | 176 | self.assertThat(lambda: self.main_view.get_feedlist_feed(feedName), Eventually(Equals(None))) |
244 | 173 | 177 | ||
245 | 174 | def _remove_topic(self, topicName): | 178 | def _remove_topic(self, topicName): |
246 | @@ -231,15 +235,15 @@ | |||
247 | 231 | return inputField | 235 | return inputField |
248 | 232 | 236 | ||
249 | 233 | def _get_topic(self, topicName, timeout = 10): | 237 | def _get_topic(self, topicName, timeout = 10): |
251 | 234 | print "_get_topic: assert topics" | 238 | logger.debug("_get_topic: assert topics") |
252 | 235 | self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName), Eventually(Not(Is(None)))) | 239 | self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName), Eventually(Not(Is(None)))) |
254 | 236 | print "_get_topic: grab topic" | 240 | logger.debug("_get_topic: grab topic") |
255 | 237 | topic = self.main_view.get_feedlist_topic(topicName) | 241 | topic = self.main_view.get_feedlist_topic(topicName) |
257 | 238 | print "_get_topic: click topic" | 242 | logger.debug("_get_topic: click topic") |
258 | 239 | 243 | ||
259 | 240 | poll = 0 | 244 | poll = 0 |
260 | 241 | while topic.isExpended == False and poll < timeout: | 245 | while topic.isExpended == False and poll < timeout: |
262 | 242 | print "_get_topic: loop click topic" | 246 | logger.debug("_get_topic: loop click topic") |
263 | 243 | self.pointing_device.click_object(topic) | 247 | self.pointing_device.click_object(topic) |
264 | 244 | sleep(1) | 248 | sleep(1) |
265 | 245 | poll += 1 | 249 | poll += 1 |
266 | @@ -257,7 +261,7 @@ | |||
267 | 257 | self._add_feed_and_topic(feed, topicName) | 261 | self._add_feed_and_topic(feed, topicName) |
268 | 258 | 262 | ||
269 | 259 | #remove added feed | 263 | #remove added feed |
271 | 260 | print "starting remove feed" | 264 | logger.debug("starting remove feed") |
272 | 261 | #12 sept 2013, | 265 | #12 sept 2013, |
273 | 262 | #this transition currently locks the device https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1221893 | 266 | #this transition currently locks the device https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1221893 |
274 | 263 | #self._remove_feed(feedName, topicName) | 267 | #self._remove_feed(feedName, topicName) |
FAILED: Continuous integration, rev:74 91.189. 93.70:8080/ job/ubuntu- rssreader- app-ci/ 56/ 91.189. 93.70:8080/ job/generic- mediumtests/ 518 91.189. 93.70:8080/ job/ubuntu- rssreader- app-precise- amd64-ci/ 56 91.189. 93.70:8080/ job/ubuntu- rssreader- app-quantal- amd64-ci/ 56 91.189. 93.70:8080/ job/ubuntu- rssreader- app-raring- amd64-ci/ 56 91.189. 93.70:8080/ job/ubuntu- rssreader- app-saucy- amd64-ci/ 56
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- rssreader- app-ci/ 56/rebuild
http://