Merge lp:~carla-sella/ubuntu-rssreader-app/all-tests-fixed into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
- all-tests-fixed
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~carla-sella/ubuntu-rssreader-app/all-tests-fixed |
Merge into: | lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk |
Diff against target: |
211 lines (+55/-26) 2 files modified
tests/autopilot/ubuntu_rssreader_app/emulators.py (+19/-7) tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+36/-19) |
To merge this branch: | bzr merge lp:~carla-sella/ubuntu-rssreader-app/all-tests-fixed |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Ubuntu Shorts Developers | Pending | ||
Review via email: mp+195138@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-11-14.
Commit message
Autopilot tests for ubuntu-
Description of the change
Fixed all tests on desktop and device.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 153. By Carla Sella <email address hidden>
-
Fixing activity indicator issue.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:153
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 154. By Carla Sella <email address hidden>
-
Working on activity indicator issue.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:154
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Joey Chan (qqworini) wrote : | # |
Carla, if u want me to approve it, pls tell me :)
Carla Sella (carla-sella) wrote : | # |
@ Joey: thanks but I am having some issues with activity indicator that have to be fixed first.
Unmerged revisions
Preview Diff
1 | === modified file 'tests/autopilot/ubuntu_rssreader_app/emulators.py' | |||
2 | --- tests/autopilot/ubuntu_rssreader_app/emulators.py 2013-11-05 02:57:36 +0000 | |||
3 | +++ tests/autopilot/ubuntu_rssreader_app/emulators.py 2013-11-13 22:02:46 +0000 | |||
4 | @@ -33,12 +33,24 @@ | |||
5 | 33 | requested = action | 33 | requested = action |
6 | 34 | self.pointing_device.click_object(requested) | 34 | self.pointing_device.click_object(requested) |
7 | 35 | 35 | ||
8 | 36 | def select_many_retry(self, object_type, **kwargs): | ||
9 | 37 | """Returns the item that is searched for with app.select_many | ||
10 | 38 | In case of no item was not found (not created yet) a second attempt is | ||
11 | 39 | taken 1 second later""" | ||
12 | 40 | items = self.select_many(object_type, **kwargs) | ||
13 | 41 | tries = 10 | ||
14 | 42 | while len(items) < 1 and tries > 0: | ||
15 | 43 | sleep(self.retry_delay) | ||
16 | 44 | items = self.select_many(object_type, **kwargs) | ||
17 | 45 | tries = tries - 1 | ||
18 | 46 | return items | ||
19 | 47 | |||
20 | 36 | def get_action_popover(self): | 48 | def get_action_popover(self): |
21 | 37 | # Returns all instances, but with current one as first index | 49 | # Returns all instances, but with current one as first index |
23 | 38 | return self.select_many("ActionSelectionPopover")[0] | 50 | return self.select_many_retry("ActionSelectionPopover")[0] |
24 | 39 | 51 | ||
25 | 40 | def get_network_activity(self): | 52 | def get_network_activity(self): |
27 | 41 | return self.select_single("ActivityIndicator", running="True") | 53 | return self.wait.select_single("ActivityIndicator", running="True") |
28 | 42 | 54 | ||
29 | 43 | #### choose topics page objects | 55 | #### choose topics page objects |
30 | 44 | 56 | ||
31 | @@ -64,7 +76,7 @@ | |||
32 | 64 | return self.wait_select_single("TopicComponent", topicName=name) | 76 | return self.wait_select_single("TopicComponent", topicName=name) |
33 | 65 | 77 | ||
34 | 66 | def get_feedlist_feed(self, feed): | 78 | def get_feedlist_feed(self, feed): |
36 | 67 | return self.select_single("FeedComponent", text=feed) | 79 | return self.wait_select_single("FeedComponent", text=feed) |
37 | 68 | 80 | ||
38 | 69 | def get_add_a_topic(self): | 81 | def get_add_a_topic(self): |
39 | 70 | return self.select_single("QQuickItem", objectName="addTopic") | 82 | return self.select_single("QQuickItem", objectName="addTopic") |
40 | @@ -105,6 +117,10 @@ | |||
41 | 105 | return self.wait_select_single( | 117 | return self.wait_select_single( |
42 | 106 | "RssFeedPage", objectName="rssfeedpage") | 118 | "RssFeedPage", objectName="rssfeedpage") |
43 | 107 | 119 | ||
44 | 120 | def get_shorts_tab(self): | ||
45 | 121 | return self.wait_select_single( | ||
46 | 122 | "ShortsTab", objectName="Tab0") | ||
47 | 123 | |||
48 | 108 | def get_topics(self): | 124 | def get_topics(self): |
49 | 109 | return self.select_single("QQuickListView", objectName="topiclist") | 125 | return self.select_single("QQuickListView", objectName="topiclist") |
50 | 110 | 126 | ||
51 | @@ -143,10 +159,6 @@ | |||
52 | 143 | def get_editfeed_done_button(self): | 159 | def get_editfeed_done_button(self): |
53 | 144 | return self.wait_select_single("Button", objectName="doneButton") | 160 | return self.wait_select_single("Button", objectName="doneButton") |
54 | 145 | 161 | ||
55 | 146 | def get_activityIndicator(self): | ||
56 | 147 | return self.wait_select_single( | ||
57 | 148 | "ActivityIndicator", objectName="activityindicator") | ||
58 | 149 | |||
59 | 150 | def get_topic_tab(self, topic): | 162 | def get_topic_tab(self, topic): |
60 | 151 | return self.wait_select_single("TopicTab", title=topic) | 163 | return self.wait_select_single("TopicTab", title=topic) |
61 | 152 | 164 | ||
62 | 153 | 165 | ||
63 | === modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py' | |||
64 | --- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-11-05 23:54:44 +0000 | |||
65 | +++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-11-13 22:02:46 +0000 | |||
66 | @@ -28,9 +28,9 @@ | |||
67 | 28 | 28 | ||
68 | 29 | #wait for any updates to finish before beginning tests | 29 | #wait for any updates to finish before beginning tests |
69 | 30 | try: | 30 | try: |
71 | 31 | self.main_view.get_activityIndicator().running.wait_for(False) | 31 | self.main_view.get_network_activity().wait_until_destroyed(timeout=10) |
72 | 32 | except: | 32 | except: |
74 | 33 | self.assertThat( | 33 | self.assertThat( |
75 | 34 | self.main_view.get_topics_page, Eventually(NotEquals(None))) | 34 | self.main_view.get_topics_page, Eventually(NotEquals(None))) |
76 | 35 | 35 | ||
77 | 36 | def _add_feed_and_topic(self, feed, topicName): | 36 | def _add_feed_and_topic(self, feed, topicName): |
78 | @@ -39,7 +39,6 @@ | |||
79 | 39 | 39 | ||
80 | 40 | self.assertThat(self.main_view.get_topics_page, | 40 | self.assertThat(self.main_view.get_topics_page, |
81 | 41 | Eventually(NotEquals(None))) | 41 | Eventually(NotEquals(None))) |
82 | 42 | |||
83 | 43 | #open toolbar | 42 | #open toolbar |
84 | 44 | logger.debug("opening toolbar") | 43 | logger.debug("opening toolbar") |
85 | 45 | toolbar = self.main_view.open_toolbar() | 44 | toolbar = self.main_view.open_toolbar() |
86 | @@ -114,16 +113,13 @@ | |||
87 | 114 | feedlistpage = self.main_view.get_feed_management_page() | 113 | feedlistpage = self.main_view.get_feed_management_page() |
88 | 115 | self.assertThat(feedlistpage.visible, Eventually(Equals(True))) | 114 | self.assertThat(feedlistpage.visible, Eventually(Equals(True))) |
89 | 116 | 115 | ||
90 | 117 | #select topic | ||
91 | 118 | logger.debug("grabbing topic") | ||
92 | 119 | self._get_topic(topicName) | ||
93 | 120 | |||
94 | 121 | ##select feed | 116 | ##select feed |
95 | 122 | logger.debug("assert feed") | 117 | logger.debug("assert feed") |
98 | 123 | self.assertThat(lambda: self.main_view.get_feedlist_feed(feedName), | 118 | self.assertThat(self.main_view.get_feedlist_feed(feedName).text, |
99 | 124 | Eventually(Not(Is(None)))) | 119 | Equals(feedName)) |
100 | 125 | logger.debug("grabbing feed") | 120 | logger.debug("grabbing feed") |
101 | 126 | feed = self.main_view.get_feedlist_feed(feedName) | 121 | feed = self.main_view.get_feedlist_feed(feedName) |
102 | 122 | feedLabel = feed.select_single('Label', text = feedName) | ||
103 | 127 | 123 | ||
104 | 128 | self.assertThat(self.main_view.get_feed_management_page, | 124 | self.assertThat(self.main_view.get_feed_management_page, |
105 | 129 | Eventually(NotEquals(None))) | 125 | Eventually(NotEquals(None))) |
106 | @@ -131,7 +127,7 @@ | |||
107 | 131 | #swipe to delete feed | 127 | #swipe to delete feed |
108 | 132 | startX = int(feedlistpage.x + feedlistpage.width * 0.30) | 128 | startX = int(feedlistpage.x + feedlistpage.width * 0.30) |
109 | 133 | stopX = int(feedlistpage.x + feedlistpage.width) | 129 | stopX = int(feedlistpage.x + feedlistpage.width) |
111 | 134 | lineY = feed.globalRect[1] | 130 | lineY = int(feedLabel.globalRect[1]) |
112 | 135 | 131 | ||
113 | 136 | #swipe to remove the feed | 132 | #swipe to remove the feed |
114 | 137 | self.pointing_device.move(startX, lineY) | 133 | self.pointing_device.move(startX, lineY) |
115 | @@ -183,6 +179,7 @@ | |||
116 | 183 | 179 | ||
117 | 184 | #select topic | 180 | #select topic |
118 | 185 | topic = self._get_topic(topicName) | 181 | topic = self._get_topic(topicName) |
119 | 182 | topicLabel = topic.select_single("Label", text=topicName) | ||
120 | 186 | 183 | ||
121 | 187 | topicmanagementpage = self.main_view.get_feed_management_page() | 184 | topicmanagementpage = self.main_view.get_feed_management_page() |
122 | 188 | self.assertThat(self.main_view.get_feed_management_page, | 185 | self.assertThat(self.main_view.get_feed_management_page, |
123 | @@ -191,7 +188,7 @@ | |||
124 | 191 | #swipe to delete topic | 188 | #swipe to delete topic |
125 | 192 | startX = int(topicmanagementpage.x + topicmanagementpage.width * 0.30) | 189 | startX = int(topicmanagementpage.x + topicmanagementpage.width * 0.30) |
126 | 193 | stopX = int(topicmanagementpage.x + topicmanagementpage.width) | 190 | stopX = int(topicmanagementpage.x + topicmanagementpage.width) |
128 | 194 | lineY = topic.globalRect[1] | 191 | lineY = topicLabel.globalRect[1] |
129 | 195 | 192 | ||
130 | 196 | #swipe to remove the topic | 193 | #swipe to remove the topic |
131 | 197 | self.pointing_device.move(startX, lineY) | 194 | self.pointing_device.move(startX, lineY) |
132 | @@ -207,9 +204,13 @@ | |||
133 | 207 | self.assertThat(self.main_view.get_feed_management_page().objectName, | 204 | self.assertThat(self.main_view.get_feed_management_page().objectName, |
134 | 208 | Eventually(Equals("topicmanagement"))) | 205 | Eventually(Equals("topicmanagement"))) |
135 | 209 | 206 | ||
139 | 210 | #check that it is gone | 207 | #check topic has been removed |
140 | 211 | topic = self.main_view.get_feedlist_topic(topicName) | 208 | logger.debug("assert removed topic") |
141 | 212 | self.assertThat(topic, NotEquals(topicName)) | 209 | try: |
142 | 210 | self.assertThat(self._get_topic(topicName), Eventually(Equals(None))) | ||
143 | 211 | except: | ||
144 | 212 | print('Topic removed.') | ||
145 | 213 | |||
146 | 213 | 214 | ||
147 | 214 | def _input_new_feed(self, rssFeed): | 215 | def _input_new_feed(self, rssFeed): |
148 | 215 | inputField = self.main_view.get_append_feed_input_box() | 216 | inputField = self.main_view.get_append_feed_input_box() |
149 | @@ -236,7 +237,7 @@ | |||
150 | 236 | def _get_topic(self, topicName, timeout=10): | 237 | def _get_topic(self, topicName, timeout=10): |
151 | 237 | logger.debug("_get_topic: assert topics") | 238 | logger.debug("_get_topic: assert topics") |
152 | 238 | self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName), | 239 | self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName), |
154 | 239 | Eventually(Not(Is(None)))) | 240 | Eventually(Not(Is([])))) |
155 | 240 | logger.debug("_get_topic: grab topic") | 241 | logger.debug("_get_topic: grab topic") |
156 | 241 | topic = self.main_view.get_feedlist_topic(topicName) | 242 | topic = self.main_view.get_feedlist_topic(topicName) |
157 | 242 | logger.debug("_get_topic: click topic") | 243 | logger.debug("_get_topic: click topic") |
158 | @@ -258,6 +259,15 @@ | |||
159 | 258 | feedName = "Canonical" | 259 | feedName = "Canonical" |
160 | 259 | topicName = "CanonicalTopic" | 260 | topicName = "CanonicalTopic" |
161 | 260 | 261 | ||
162 | 262 | #just for timing issues | ||
163 | 263 | self.assertThat(self.main_view.get_shorts_tab(), | ||
164 | 264 | NotEquals(None)) | ||
165 | 265 | self.assertThat(self.main_view.get_shorts_tab().objectName, | ||
166 | 266 | Eventually(Equals("Tab0"))) | ||
167 | 267 | self.assertThat(self.main_view.get_shorts_tab().visible, | ||
168 | 268 | Eventually(Equals(True))) | ||
169 | 269 | |||
170 | 270 | #add feed and topic | ||
171 | 261 | self._add_feed_and_topic(feed, topicName) | 271 | self._add_feed_and_topic(feed, topicName) |
172 | 262 | 272 | ||
173 | 263 | #remove added feed | 273 | #remove added feed |
174 | @@ -275,6 +285,14 @@ | |||
175 | 275 | feedName = "Canonical" | 285 | feedName = "Canonical" |
176 | 276 | topicName = "CanonicalTopic" | 286 | topicName = "CanonicalTopic" |
177 | 277 | 287 | ||
178 | 288 | #just for timing issues | ||
179 | 289 | self.assertThat(self.main_view.get_shorts_tab(), | ||
180 | 290 | NotEquals(None)) | ||
181 | 291 | self.assertThat(self.main_view.get_shorts_tab().objectName, | ||
182 | 292 | Eventually(Equals("Tab0"))) | ||
183 | 293 | self.assertThat(self.main_view.get_shorts_tab().visible, | ||
184 | 294 | Eventually(Equals(True))) | ||
185 | 295 | |||
186 | 278 | #add topic and feed | 296 | #add topic and feed |
187 | 279 | self._add_feed_and_topic(feed, topicName) | 297 | self._add_feed_and_topic(feed, topicName) |
188 | 280 | 298 | ||
189 | @@ -290,11 +308,10 @@ | |||
190 | 290 | 308 | ||
191 | 291 | #wait for any updates to finish before continuing tests | 309 | #wait for any updates to finish before continuing tests |
192 | 292 | try: | 310 | try: |
194 | 293 | self.main_view.get_activityIndicator().running.wait_for(False) | 311 | self.main_view.get_network_activity().running.wait_for(False) |
195 | 294 | except: | 312 | except: |
196 | 295 | self.assertThat( | 313 | self.assertThat( |
199 | 296 | lambda: self.main_view.get_topic_tab(topicName), | 314 | self.main_view.get_topic_tab(topicName), Not(Is([]))) |
198 | 297 | Eventually(NotEquals(None))) | ||
200 | 298 | 315 | ||
201 | 299 | #open toolbar | 316 | #open toolbar |
202 | 300 | toolbar = self.main_view.open_toolbar() | 317 | toolbar = self.main_view.open_toolbar() |
203 | @@ -308,7 +325,7 @@ | |||
204 | 308 | 325 | ||
205 | 309 | #select feed | 326 | #select feed |
206 | 310 | editFeed = self.main_view.get_feed_in_feedlist(topicName, feedName) | 327 | editFeed = self.main_view.get_feed_in_feedlist(topicName, feedName) |
208 | 311 | self.assertThat(editFeed, NotEquals(None)) | 328 | self.assertThat(editFeed, Not(Is([]))) |
209 | 312 | self.pointing_device.click_object(editFeed) | 329 | self.pointing_device.click_object(editFeed) |
210 | 313 | 330 | ||
211 | 314 | #verify we are on RSS feed page | 331 | #verify we are on RSS feed page |
FAILED: Continuous integration, rev:152 91.189. 93.70:8080/ job/ubuntu- rssreader- app-ci/ 127/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 131/console 91.189. 93.70:8080/ job/ubuntu- rssreader- app-raring- amd64-ci/ 127 91.189. 93.70:8080/ job/ubuntu- rssreader- app-saucy- amd64-ci/ 127 91.189. 93.70:8080/ job/ubuntu- rssreader- app-trusty- amd64-ci/ 14
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- rssreader- app-ci/ 127/rebuild
http://