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
1=== modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py'
2--- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-13 21:02:12 +0000
3+++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-13 23:11:16 +0000
4@@ -18,8 +18,7 @@
5 import shutil
6
7 from autopilot.matchers import Eventually
8-from testtools.matchers import Equals
9-from testtools.matchers import NotEquals
10+from testtools.matchers import Equals, NotEquals, Is, Not
11
12 from autopilot.introspection.dbus import StateNotFoundError
13 from ubuntu_rssreader_app.tests import RssReaderAppTestCase
14@@ -35,9 +34,9 @@
15 def _add_feed_and_topic(self):
16 """test add feed and topic"""
17
18- #verify we are on the first page
19- shortsPage = self.main_view.switch_to_tab_by_index(0)
20- self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))
21+ #verify we are on the first page)
22+ shortsPage = lambda: self.main_view.switch_to_tab_by_index(0).visible
23+ self.assertThat(shortsPage, Eventually(Equals(True)))
24
25 #open toolbar
26 toolbar = self.main_view.open_toolbar()
27@@ -50,50 +49,50 @@
28 self.main_view.run_action(addReadsPopover, "+ Add feeds")
29
30 #verify Append Feed page is open
31- appendpage = self.main_view.get_append_page()
32- self.assertThat(lambda: appendpage.visible, Eventually(Equals(True)))
33+ appendpage = lambda: self.main_view.get_append_page().visible
34+ self.assertThat(appendpage, Eventually(Equals(True)))
35
36 #type feed in input field
37 self._input_new_feed("http://www.canonical.com/rss.xml")
38
39 #check that feed is updated, not empty
40+ self.assertThat(self.main_view.get_canonical_feed_labelvisual, Eventually(Not(Is(None))))
41 canonicalFeed = self.main_view.get_canonical_feed_labelvisual()
42- self.assertThat(lambda: canonicalFeed, Eventually(NotEquals(None)))
43- self.assertThat(lambda: canonicalFeed.text, Eventually(Equals("Canonical")))
44+ self.assertThat(canonicalFeed.text, Eventually(Equals("Canonical")))
45
46 #click on checkbox to confirm feed
47+ self.assertThat(self.main_view.get_checkbox_button, Eventually(Not(Is(None))))
48 checkboxBtn = self.main_view.get_checkbox_button()
49- self.assertThat(lambda: checkboxBtn, Eventually(NotEquals(None)))
50 self.pointing_device.click_object(checkboxBtn)
51- self.assertThat(lambda: checkboxBtn.checked, Eventually(Equals(True)))
52+ self.assertThat(checkboxBtn.checked, Eventually(Equals(True)))
53
54 #click on Next button
55+ self.assertThat(self.main_view.get_next_button, Eventually(Not(Is(None))))
56 nextButton = self.main_view.get_next_button()
57- self.assertThat(lambda: nextButton, Eventually(NotEquals(None)))
58 self.pointing_device.click_object(nextButton)
59
60- chossetopicpage = self.main_view.get_topics_page()
61- self.assertThat(lambda: chossetopicpage.visible, Eventually(Equals(True)))
62+ chossetopicpage = lambda: self.main_view.get_topics_page().visible
63+ self.assertThat(chossetopicpage, Eventually(Equals(True)))
64
65 #add a new topic
66 self._input_new_topic("CanonicalTopic")
67
68 #select canonical topic
69+ self.assertThat(self.main_view.get_canonical_topic_labelvisual, Eventually(Not(Is(None))))
70 canonicalTopic = self.main_view.get_canonical_topic_labelvisual()
71- self.assertThat(lambda: canonicalTopic, Eventually(NotEquals(None)))
72 self.pointing_device.click_object(canonicalTopic)
73
74 #just for timing purposes
75- self.assertThat(lambda: canonicalTopic.text, Eventually(Equals("CanonicalTopic")))
76+ self.assertThat(canonicalTopic.text, Eventually(Equals("CanonicalTopic")))
77
78 #verify we are on the first page
79- shortsPage = self.main_view.switch_to_tab_by_index(0)
80- self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))
81+ shortsPage = self.main_view.switch_to_tab_by_index(0).visible
82+ self.assertThat(shortsPage, Eventually(Equals(True)))
83
84 def _remove_feed(self):
85 #verify we are on the first page
86- shortsPage = self.main_view.switch_to_tab_by_index(0)
87- self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))
88+ shortsPage = self.main_view.switch_to_tab_by_index(0).visible
89+ self.assertThat(shortsPage, Eventually(Equals(True)))
90
91 #open toolbar
92 toolbar = self.main_view.open_toolbar()
93@@ -102,16 +101,15 @@
94 toolbar.click_button("edittopicsbutton")
95
96 #verify we are on the Management page
97- feedlistpage = self.main_view.get_feed_management_page()
98- self.assertThat(feedlistpage.visible, Eventually(Equals(True)))
99+ feedlistpage = lambda: self.main_view.get_feed_management_page().visible
100+ self.assertThat(feedlistpage, Eventually(Equals(True)))
101
102 #select canonical topic
103 self._get_canonical_topic()
104
105 #select canonical feed
106+ self.assertThat(self.main_view.get_canonical_feed_FeedComponent, Eventually(Not(Is(None))))
107 canonicalFeed = self.main_view.get_canonical_feed_FeedComponent()
108- self.assertThat(lambda: canonicalFeed, Eventually(NotEquals(None)))
109-
110 self.pointing_device.click_object(canonicalFeed)
111
112 #verify we are on the Edit Feed page
113@@ -122,29 +120,27 @@
114 self.main_view.open_toolbar()
115
116 #press delete button
117+ self.assertThat(self.main_view.get_delete_button, Eventually(Not(Is(None))))
118 deleteButton = self.main_view.get_delete_button()
119- self.assertThat(lambda: deleteButton, Eventually(NotEquals(None)))
120 self.pointing_device.click_object(deleteButton)
121
122 #verify we are on the Management page
123- feedlistpage = self.main_view.get_feed_management_page()
124- self.assertThat(feedlistpage.visible, Eventually(Equals(True)))
125+ feedlistpage = lambda: self.main_view.get_feed_management_page().visible
126+ self.assertThat(feedlistpage, Eventually(Equals(True)))
127
128- #select canonical topic
129- canonicalTopic = self.main_view.get_canonical_topic_labelvisual()
130- self.assertThat(lambda: canonicalTopic, Eventually(NotEquals(None)))
131+ #check canonical topic
132+ self.assertThat(self.main_view.get_canonical_topic_labelvisual, Eventually(Not(Is(None))))
133
134 #check feed has been removed
135- canonicalFeed = self.main_view.get_canonical_feed_FeedComponent()
136- self.assertThat(lambda: canonicalFeed, Eventually(Equals(None)))
137+ self.assertThat(self.main_view.get_canonical_feed_FeedComponent, Eventually(Equals(None)))
138
139 def _remove_topic(self):
140 #this been quasi converted to the sdk, but does not work as-is
141 #see https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1211631
142
143 #verify we are on the first page
144- shortsPage = self.main_view.switch_to_tab_by_index(0)
145- self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))
146+ shortsPage = self.main_view.switch_to_tab_by_index(0).visible
147+ self.assertThat(shortsPage, Eventually(Equals(True)))
148
149 #open toolbar
150 toolbar = self.main_view.open_toolbar()
151@@ -160,10 +156,10 @@
152 canonicalTopic = self._get_canonical_topic()
153
154 topicsPage = self.main_view.get_manage_topics_page()
155- self.assertThat(topicsPage, Eventually(NotEquals(None)))
156+ self.assertThat(topicsPage, Eventually(Not(Is(None))))
157
158- addATopicItem = self.main_view.get_add_a_topic()
159- self.assertThat(lambda: addATopic, Eventually(NotEquals(None)))
160+ addATopicItem = lambda: self.main_view.get_add_a_topic()
161+ self.assertThat(addATopic, Eventually(Not(Is(None))))
162
163 #swipe to delete canonical topic
164 #we have to consider the top tab offset, then create a swipe operation across the width of the page
165@@ -177,8 +173,8 @@
166 self.pointing_device.drag(startX, lineY, stopX, lineY)
167
168 #check that it is gone
169- canonicalTopic = self.main_view.get_canonical_topic()
170- self.assertThat(lambda: canonicalTopic.visible, Eventually(Equals(False)))
171+ canonicalTopic = lambda: self.main_view.get_canonical_topic()
172+ self.assertThat(canonicalTopic.visible, Eventually(Equals(False)))
173
174 def _input_new_feed(self, rssFeed):
175 inputField = self.main_view.get_append_feed_input_box()
176@@ -189,7 +185,6 @@
177 return self._safe_enter_text(inputField, topic)
178
179 def _safe_enter_text(self, inputField, text, timeout = 10):
180- self.assertThat(lambda: inputField.visible, Eventually(Equals(True)))
181 #poll clicking for focus for lack of better method, due to screen switching animation
182 #is there a property we can use instead?
183 poll = 0
184@@ -203,8 +198,8 @@
185 return inputField
186
187 def _get_canonical_topic(self, timeout = 10):
188+ self.assertThat(self.main_view.get_canonical_topic_TopicComponent, Eventually(Not(Is(None))))
189 canonicalTopic = self.main_view.get_canonical_topic_TopicComponent()
190- self.assertThat(lambda: canonicalTopic, Eventually(NotEquals(None)))
191 self.pointing_device.click_object(canonicalTopic)
192
193 poll = 0
194@@ -234,8 +229,8 @@
195 """test view feeds"""
196
197 #verify we are on the first page
198- self.main_view.switch_to_tab_by_index(0)
199- self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))
200+ shortsPage = lambda: self.main_view.switch_to_tab_by_index(0).visible
201+ self.assertThat(shortsPage, Eventually(Equals(True)))
202
203 #-----> view all news:
204 #open toolbar
205@@ -246,7 +241,7 @@
206
207 #verify we are on the Feeds page
208 feedlistpage = self.main_view.get_feedlist_page()
209- self.assertThat(lambda: feedlistpage.visible, Eventually(Equals(True)))
210+ self.assertThat(feedlistpage.visible, Eventually(Equals(True)))
211
212 #select All articles
213 allFeeds = self.main_view.get_all_feeds()
214@@ -255,7 +250,7 @@
215
216 #verify we are on the All articles page
217 articlelistpage = self.main_view.get_articlelist_page()
218- self.assertThat(lambda: articlelistpage.visible, Eventually(Equals(True)))
219+ self.assertThat(articlelistpage.visible, Eventually(Equals(True)))
220
221 toolbar = self.main_view.open_toolbar()
222
223@@ -263,21 +258,21 @@
224 toolbar.click_button("Back")
225
226 #verify we are on the Feeds page
227- feedlistpage = self.main_view.get_feedlist_page()
228- self.assertThat(lambda: feedlistpage.visible, Eventually(Equals(True)))
229+ feedlistpage = lambda: self.main_view.get_feedlist_page().visible
230+ self.assertThat(feedlistpage, Eventually(Equals(True)))
231
232 #-----> view individual feed:
233 #add topic and feed
234 self._add_feed_and_topic()
235
236 #select Canonical feed
237- canonicalFeed = self.main_view.get_canonical_feed_labelvisual()
238- self.assertThat(lambda: canonicalFeed, Eventually(NotEquals(None)))
239+ canonicalFeed = lambda: self.main_view.get_canonical_feed_labelvisual()
240+ self.assertThat(canonicalFeed, Eventually(Not(Is(None))))
241 self.pointing_device.click_object(canonicalFeed)
242
243 #verify we are on the Canonical page
244- header = self.main_view.get_header()[0]
245- self.assertThat(lambda: header.title, Eventually(Equals("Canonical")))
246+ header = lambda: self.main_view.get_header()[0].title
247+ self.assertThat(header, Eventually(Equals("Canonical")))
248
249 #toggle toolbar
250 toolbar = self.main_view.open_toolbar()
251@@ -286,8 +281,8 @@
252 toolbar.click_button("Back")
253
254 #verify we are on the Feeds page
255- feedlistpage = self.main_view.get_feedlist_page()
256- self.assertThat(lambda: feedlistpage.visible, Eventually(Equals(True)))
257+ feedlistpage = lambda: self.main_view.get_feedlist_page().visible
258+ self.assertThat(feedlistpage, Eventually(Equals(True)))
259
260 #toggle toolbar
261 toolbar = self.main_view.open_toolbar()
262@@ -296,8 +291,8 @@
263 toolbar.click_button("shorts")
264
265 #verify we are on the Shorts page
266- self.main_view.switch_to_tab_by_index(0)
267- self.assertThat(lambda: shortsPage.visible, Eventually(Equals(True)))
268+ shortsPage = lambda: self.main_view.switch_to_tab_by_index(0).visible
269+ self.assertThat(shortsPage, Eventually(Equals(True)))
270
271 #remove added Canonical topic
272 self._remove_topic()

Subscribers

People subscribed via source and target branches