Merge lp:~nskaggs/ubuntu-rssreader-app/ap-tweaks-force-build into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 39
Merged at revision: 38
Proposed branch: lp:~nskaggs/ubuntu-rssreader-app/ap-tweaks-force-build
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 272 lines (+50/-55)
1 file modified
tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+50/-55)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-rssreader-app/ap-tweaks-force-build
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Shorts Developers Pending
Review via email: mp+180016@code.launchpad.net

This proposal supersedes a proposal from 2013-08-13.

Commit message

Tweak autopilot tests, force new build into ppa

Description of the change

Tweak autopilot tests, force new build into ppa

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py'
--- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-13 21:02:12 +0000
+++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-13 23:11:16 +0000
@@ -18,8 +18,7 @@
18import shutil18import shutil
1919
20from autopilot.matchers import Eventually20from autopilot.matchers import Eventually
21from testtools.matchers import Equals21from testtools.matchers import Equals, NotEquals, Is, Not
22from testtools.matchers import NotEquals
2322
24from autopilot.introspection.dbus import StateNotFoundError23from autopilot.introspection.dbus import StateNotFoundError
25from ubuntu_rssreader_app.tests import RssReaderAppTestCase24from ubuntu_rssreader_app.tests import RssReaderAppTestCase
@@ -35,9 +34,9 @@
35 def _add_feed_and_topic(self):34 def _add_feed_and_topic(self):
36 """test add feed and topic"""35 """test add feed and topic"""
3736
38 #verify we are on the first page37 #verify we are on the first page)
39 shortsPage = self.main_view.switch_to_tab_by_index(0)38 shortsPage = lambda: self.main_view.switch_to_tab_by_index(0).visible
40 self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))39 self.assertThat(shortsPage, Eventually(Equals(True)))
4140
42 #open toolbar41 #open toolbar
43 toolbar = self.main_view.open_toolbar()42 toolbar = self.main_view.open_toolbar()
@@ -50,50 +49,50 @@
50 self.main_view.run_action(addReadsPopover, "+ Add feeds")49 self.main_view.run_action(addReadsPopover, "+ Add feeds")
5150
52 #verify Append Feed page is open51 #verify Append Feed page is open
53 appendpage = self.main_view.get_append_page()52 appendpage = lambda: self.main_view.get_append_page().visible
54 self.assertThat(lambda: appendpage.visible, Eventually(Equals(True)))53 self.assertThat(appendpage, Eventually(Equals(True)))
5554
56 #type feed in input field55 #type feed in input field
57 self._input_new_feed("http://www.canonical.com/rss.xml")56 self._input_new_feed("http://www.canonical.com/rss.xml")
5857
59 #check that feed is updated, not empty58 #check that feed is updated, not empty
59 self.assertThat(self.main_view.get_canonical_feed_labelvisual, Eventually(Not(Is(None))))
60 canonicalFeed = self.main_view.get_canonical_feed_labelvisual()60 canonicalFeed = self.main_view.get_canonical_feed_labelvisual()
61 self.assertThat(lambda: canonicalFeed, Eventually(NotEquals(None)))61 self.assertThat(canonicalFeed.text, Eventually(Equals("Canonical")))
62 self.assertThat(lambda: canonicalFeed.text, Eventually(Equals("Canonical")))
6362
64 #click on checkbox to confirm feed63 #click on checkbox to confirm feed
64 self.assertThat(self.main_view.get_checkbox_button, Eventually(Not(Is(None))))
65 checkboxBtn = self.main_view.get_checkbox_button()65 checkboxBtn = self.main_view.get_checkbox_button()
66 self.assertThat(lambda: checkboxBtn, Eventually(NotEquals(None)))
67 self.pointing_device.click_object(checkboxBtn)66 self.pointing_device.click_object(checkboxBtn)
68 self.assertThat(lambda: checkboxBtn.checked, Eventually(Equals(True)))67 self.assertThat(checkboxBtn.checked, Eventually(Equals(True)))
6968
70 #click on Next button69 #click on Next button
70 self.assertThat(self.main_view.get_next_button, Eventually(Not(Is(None))))
71 nextButton = self.main_view.get_next_button()71 nextButton = self.main_view.get_next_button()
72 self.assertThat(lambda: nextButton, Eventually(NotEquals(None)))
73 self.pointing_device.click_object(nextButton)72 self.pointing_device.click_object(nextButton)
7473
75 chossetopicpage = self.main_view.get_topics_page()74 chossetopicpage = lambda: self.main_view.get_topics_page().visible
76 self.assertThat(lambda: chossetopicpage.visible, Eventually(Equals(True)))75 self.assertThat(chossetopicpage, Eventually(Equals(True)))
7776
78 #add a new topic77 #add a new topic
79 self._input_new_topic("CanonicalTopic")78 self._input_new_topic("CanonicalTopic")
8079
81 #select canonical topic80 #select canonical topic
81 self.assertThat(self.main_view.get_canonical_topic_labelvisual, Eventually(Not(Is(None))))
82 canonicalTopic = self.main_view.get_canonical_topic_labelvisual()82 canonicalTopic = self.main_view.get_canonical_topic_labelvisual()
83 self.assertThat(lambda: canonicalTopic, Eventually(NotEquals(None)))
84 self.pointing_device.click_object(canonicalTopic)83 self.pointing_device.click_object(canonicalTopic)
8584
86 #just for timing purposes85 #just for timing purposes
87 self.assertThat(lambda: canonicalTopic.text, Eventually(Equals("CanonicalTopic")))86 self.assertThat(canonicalTopic.text, Eventually(Equals("CanonicalTopic")))
8887
89 #verify we are on the first page88 #verify we are on the first page
90 shortsPage = self.main_view.switch_to_tab_by_index(0)89 shortsPage = self.main_view.switch_to_tab_by_index(0).visible
91 self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))90 self.assertThat(shortsPage, Eventually(Equals(True)))
9291
93 def _remove_feed(self):92 def _remove_feed(self):
94 #verify we are on the first page93 #verify we are on the first page
95 shortsPage = self.main_view.switch_to_tab_by_index(0)94 shortsPage = self.main_view.switch_to_tab_by_index(0).visible
96 self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))95 self.assertThat(shortsPage, Eventually(Equals(True)))
9796
98 #open toolbar97 #open toolbar
99 toolbar = self.main_view.open_toolbar()98 toolbar = self.main_view.open_toolbar()
@@ -102,16 +101,15 @@
102 toolbar.click_button("edittopicsbutton")101 toolbar.click_button("edittopicsbutton")
103102
104 #verify we are on the Management page103 #verify we are on the Management page
105 feedlistpage = self.main_view.get_feed_management_page()104 feedlistpage = lambda: self.main_view.get_feed_management_page().visible
106 self.assertThat(feedlistpage.visible, Eventually(Equals(True)))105 self.assertThat(feedlistpage, Eventually(Equals(True)))
107106
108 #select canonical topic107 #select canonical topic
109 self._get_canonical_topic()108 self._get_canonical_topic()
110109
111 #select canonical feed110 #select canonical feed
111 self.assertThat(self.main_view.get_canonical_feed_FeedComponent, Eventually(Not(Is(None))))
112 canonicalFeed = self.main_view.get_canonical_feed_FeedComponent()112 canonicalFeed = self.main_view.get_canonical_feed_FeedComponent()
113 self.assertThat(lambda: canonicalFeed, Eventually(NotEquals(None)))
114
115 self.pointing_device.click_object(canonicalFeed)113 self.pointing_device.click_object(canonicalFeed)
116114
117 #verify we are on the Edit Feed page115 #verify we are on the Edit Feed page
@@ -122,29 +120,27 @@
122 self.main_view.open_toolbar()120 self.main_view.open_toolbar()
123121
124 #press delete button122 #press delete button
123 self.assertThat(self.main_view.get_delete_button, Eventually(Not(Is(None))))
125 deleteButton = self.main_view.get_delete_button()124 deleteButton = self.main_view.get_delete_button()
126 self.assertThat(lambda: deleteButton, Eventually(NotEquals(None)))
127 self.pointing_device.click_object(deleteButton)125 self.pointing_device.click_object(deleteButton)
128126
129 #verify we are on the Management page127 #verify we are on the Management page
130 feedlistpage = self.main_view.get_feed_management_page()128 feedlistpage = lambda: self.main_view.get_feed_management_page().visible
131 self.assertThat(feedlistpage.visible, Eventually(Equals(True)))129 self.assertThat(feedlistpage, Eventually(Equals(True)))
132130
133 #select canonical topic131 #check canonical topic
134 canonicalTopic = self.main_view.get_canonical_topic_labelvisual()132 self.assertThat(self.main_view.get_canonical_topic_labelvisual, Eventually(Not(Is(None))))
135 self.assertThat(lambda: canonicalTopic, Eventually(NotEquals(None)))
136133
137 #check feed has been removed134 #check feed has been removed
138 canonicalFeed = self.main_view.get_canonical_feed_FeedComponent()135 self.assertThat(self.main_view.get_canonical_feed_FeedComponent, Eventually(Equals(None)))
139 self.assertThat(lambda: canonicalFeed, Eventually(Equals(None)))
140136
141 def _remove_topic(self):137 def _remove_topic(self):
142 #this been quasi converted to the sdk, but does not work as-is138 #this been quasi converted to the sdk, but does not work as-is
143 #see https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1211631139 #see https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1211631
144140
145 #verify we are on the first page141 #verify we are on the first page
146 shortsPage = self.main_view.switch_to_tab_by_index(0)142 shortsPage = self.main_view.switch_to_tab_by_index(0).visible
147 self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))143 self.assertThat(shortsPage, Eventually(Equals(True)))
148144
149 #open toolbar145 #open toolbar
150 toolbar = self.main_view.open_toolbar()146 toolbar = self.main_view.open_toolbar()
@@ -160,10 +156,10 @@
160 canonicalTopic = self._get_canonical_topic()156 canonicalTopic = self._get_canonical_topic()
161157
162 topicsPage = self.main_view.get_manage_topics_page()158 topicsPage = self.main_view.get_manage_topics_page()
163 self.assertThat(topicsPage, Eventually(NotEquals(None)))159 self.assertThat(topicsPage, Eventually(Not(Is(None))))
164160
165 addATopicItem = self.main_view.get_add_a_topic()161 addATopicItem = lambda: self.main_view.get_add_a_topic()
166 self.assertThat(lambda: addATopic, Eventually(NotEquals(None)))162 self.assertThat(addATopic, Eventually(Not(Is(None))))
167163
168 #swipe to delete canonical topic164 #swipe to delete canonical topic
169 #we have to consider the top tab offset, then create a swipe operation across the width of the page165 #we have to consider the top tab offset, then create a swipe operation across the width of the page
@@ -177,8 +173,8 @@
177 self.pointing_device.drag(startX, lineY, stopX, lineY)173 self.pointing_device.drag(startX, lineY, stopX, lineY)
178174
179 #check that it is gone175 #check that it is gone
180 canonicalTopic = self.main_view.get_canonical_topic()176 canonicalTopic = lambda: self.main_view.get_canonical_topic()
181 self.assertThat(lambda: canonicalTopic.visible, Eventually(Equals(False)))177 self.assertThat(canonicalTopic.visible, Eventually(Equals(False)))
182178
183 def _input_new_feed(self, rssFeed):179 def _input_new_feed(self, rssFeed):
184 inputField = self.main_view.get_append_feed_input_box()180 inputField = self.main_view.get_append_feed_input_box()
@@ -189,7 +185,6 @@
189 return self._safe_enter_text(inputField, topic)185 return self._safe_enter_text(inputField, topic)
190186
191 def _safe_enter_text(self, inputField, text, timeout = 10):187 def _safe_enter_text(self, inputField, text, timeout = 10):
192 self.assertThat(lambda: inputField.visible, Eventually(Equals(True)))
193 #poll clicking for focus for lack of better method, due to screen switching animation188 #poll clicking for focus for lack of better method, due to screen switching animation
194 #is there a property we can use instead?189 #is there a property we can use instead?
195 poll = 0190 poll = 0
@@ -203,8 +198,8 @@
203 return inputField198 return inputField
204199
205 def _get_canonical_topic(self, timeout = 10):200 def _get_canonical_topic(self, timeout = 10):
201 self.assertThat(self.main_view.get_canonical_topic_TopicComponent, Eventually(Not(Is(None))))
206 canonicalTopic = self.main_view.get_canonical_topic_TopicComponent()202 canonicalTopic = self.main_view.get_canonical_topic_TopicComponent()
207 self.assertThat(lambda: canonicalTopic, Eventually(NotEquals(None)))
208 self.pointing_device.click_object(canonicalTopic)203 self.pointing_device.click_object(canonicalTopic)
209204
210 poll = 0205 poll = 0
@@ -234,8 +229,8 @@
234 """test view feeds"""229 """test view feeds"""
235230
236 #verify we are on the first page231 #verify we are on the first page
237 self.main_view.switch_to_tab_by_index(0)232 shortsPage = lambda: self.main_view.switch_to_tab_by_index(0).visible
238 self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))233 self.assertThat(shortsPage, Eventually(Equals(True)))
239234
240 #-----> view all news:235 #-----> view all news:
241 #open toolbar236 #open toolbar
@@ -246,7 +241,7 @@
246241
247 #verify we are on the Feeds page242 #verify we are on the Feeds page
248 feedlistpage = self.main_view.get_feedlist_page()243 feedlistpage = self.main_view.get_feedlist_page()
249 self.assertThat(lambda: feedlistpage.visible, Eventually(Equals(True)))244 self.assertThat(feedlistpage.visible, Eventually(Equals(True)))
250245
251 #select All articles246 #select All articles
252 allFeeds = self.main_view.get_all_feeds()247 allFeeds = self.main_view.get_all_feeds()
@@ -255,7 +250,7 @@
255250
256 #verify we are on the All articles page251 #verify we are on the All articles page
257 articlelistpage = self.main_view.get_articlelist_page()252 articlelistpage = self.main_view.get_articlelist_page()
258 self.assertThat(lambda: articlelistpage.visible, Eventually(Equals(True)))253 self.assertThat(articlelistpage.visible, Eventually(Equals(True)))
259254
260 toolbar = self.main_view.open_toolbar()255 toolbar = self.main_view.open_toolbar()
261256
@@ -263,21 +258,21 @@
263 toolbar.click_button("Back")258 toolbar.click_button("Back")
264259
265 #verify we are on the Feeds page260 #verify we are on the Feeds page
266 feedlistpage = self.main_view.get_feedlist_page()261 feedlistpage = lambda: self.main_view.get_feedlist_page().visible
267 self.assertThat(lambda: feedlistpage.visible, Eventually(Equals(True)))262 self.assertThat(feedlistpage, Eventually(Equals(True)))
268263
269 #-----> view individual feed:264 #-----> view individual feed:
270 #add topic and feed265 #add topic and feed
271 self._add_feed_and_topic()266 self._add_feed_and_topic()
272267
273 #select Canonical feed268 #select Canonical feed
274 canonicalFeed = self.main_view.get_canonical_feed_labelvisual()269 canonicalFeed = lambda: self.main_view.get_canonical_feed_labelvisual()
275 self.assertThat(lambda: canonicalFeed, Eventually(NotEquals(None)))270 self.assertThat(canonicalFeed, Eventually(Not(Is(None))))
276 self.pointing_device.click_object(canonicalFeed)271 self.pointing_device.click_object(canonicalFeed)
277272
278 #verify we are on the Canonical page273 #verify we are on the Canonical page
279 header = self.main_view.get_header()[0]274 header = lambda: self.main_view.get_header()[0].title
280 self.assertThat(lambda: header.title, Eventually(Equals("Canonical")))275 self.assertThat(header, Eventually(Equals("Canonical")))
281276
282 #toggle toolbar277 #toggle toolbar
283 toolbar = self.main_view.open_toolbar()278 toolbar = self.main_view.open_toolbar()
@@ -286,8 +281,8 @@
286 toolbar.click_button("Back")281 toolbar.click_button("Back")
287282
288 #verify we are on the Feeds page283 #verify we are on the Feeds page
289 feedlistpage = self.main_view.get_feedlist_page()284 feedlistpage = lambda: self.main_view.get_feedlist_page().visible
290 self.assertThat(lambda: feedlistpage.visible, Eventually(Equals(True)))285 self.assertThat(feedlistpage, Eventually(Equals(True)))
291286
292 #toggle toolbar287 #toggle toolbar
293 toolbar = self.main_view.open_toolbar()288 toolbar = self.main_view.open_toolbar()
@@ -296,8 +291,8 @@
296 toolbar.click_button("shorts")291 toolbar.click_button("shorts")
297292
298 #verify we are on the Shorts page293 #verify we are on the Shorts page
299 self.main_view.switch_to_tab_by_index(0)294 shortsPage = lambda: self.main_view.switch_to_tab_by_index(0).visible
300 self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))295 self.assertThat(shortsPage, Eventually(Equals(True)))
301296
302 #remove added Canonical topic297 #remove added Canonical topic
303 self._remove_topic()298 self._remove_topic()

Subscribers

People subscribed via source and target branches