Merge lp:~elopio/ubuntu-rssreader-app/autopilot-1.4 into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/ubuntu-rssreader-app/autopilot-1.4
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 185 lines (+27/-45)
4 files modified
listview/ListModePage.qml (+1/-0)
tests/autopilot/ubuntu_rssreader_app/emulators.py (+12/-36)
tests/autopilot/ubuntu_rssreader_app/tests/__init__.py (+7/-3)
tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+7/-6)
To merge this branch: bzr merge lp:~elopio/ubuntu-rssreader-app/autopilot-1.4
Reviewer Review Type Date Requested Status
Chris Gagnon (community) Needs Fixing
Thomi Richards (community) Approve
Ubuntu Shorts Developers Pending
Review via email: mp+193355@code.launchpad.net

This proposal has been superseded by a proposal from 2013-11-05.

Commit message

Update tests for autopilot 1.4

Description of the change

Tests are failing because of bug https://bugs.launchpad.net/ubuntu-rssreader-app/+bug/1246501
They fail with autopilot 1.3 and 1.4.

To post a comment you must log in.
Revision history for this message
Joey Chan (qqworini) wrote :

So... do I need to fix bug #1246501 first or approve this first ?

Revision history for this message
Leo Arias (elopio) wrote :

First fix the bug, please. This branch can't land until the Jenkins runners are using autopilot 1.4.

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM. Do not approve until AP 1.4 lands.

review: Approve
131. By Leo Arias

Merged with trunk.

132. By Leo Arias

Use the qmlscene launch command from the toolkit.

133. By Leo Arias

Merged with precondition branch.

Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

161 + self.assertThat(
162 + self.main_view.get_feedlist_topic(topicName), Not(Is(None)))

This will never return none, a dbus.StateNotFound error will be raised first.

review: Needs Fixing
134. By Leo Arias

The method will never return None.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'listview/ListModePage.qml'
2--- listview/ListModePage.qml 2013-10-30 20:05:10 +0000
3+++ listview/ListModePage.qml 2013-11-05 03:02:07 +0000
4@@ -149,6 +149,7 @@
5
6 Label {
7 id: labelFeedname
8+ objectName: "labelFeedname"
9
10 text: model.feed_name
11 fontSize: "x-small"
12
13=== modified file 'tests/autopilot/ubuntu_rssreader_app/emulators.py'
14--- tests/autopilot/ubuntu_rssreader_app/emulators.py 2013-10-10 16:52:39 +0000
15+++ tests/autopilot/ubuntu_rssreader_app/emulators.py 2013-11-05 03:02:07 +0000
16@@ -33,30 +33,6 @@
17 requested = action
18 self.pointing_device.click_object(requested)
19
20- def select_single_retry(self, object_type, **kwargs):
21- """Returns the item that is searched for with app.select_single
22- In case of the item was not found (not created yet) a second attempt is
23- taken 1 second later."""
24- item = self.select_single(object_type, **kwargs)
25- tries = 10
26- while item is None and tries > 0:
27- sleep(self.retry_delay)
28- item = self.select_single(object_type, **kwargs)
29- tries = tries - 1
30- return item
31-
32- def select_many_retry(self, object_type, **kwargs):
33- """Returns the item that is searched for with app.select_many
34- In case of no item was not found (not created yet) a second attempt is
35- taken 1 second later"""
36- items = self.select_many(object_type, **kwargs)
37- tries = 10
38- while len(items) < 1 and tries > 0:
39- sleep(self.retry_delay)
40- items = self.select_many(object_type, **kwargs)
41- tries = tries - 1
42- return items
43-
44 def get_action_popover(self):
45 # Returns all instances, but with current one as first index
46 return self.select_many("ActionSelectionPopover")[0]
47@@ -85,7 +61,7 @@
48
49 #### feed list page objects
50 def get_feedlist_topic(self, name):
51- return self.select_single_retry("TopicComponent", topicName=name)
52+ return self.wait_select_single("TopicComponent", topicName=name)
53
54 def get_feedlist_feed(self, feed):
55 return self.select_single("FeedComponent", text=feed)
56@@ -107,7 +83,7 @@
57 objectName="choosetopicpage")
58
59 def get_feedlist_page(self):
60- return self.select_single_retry("FeedListPage",
61+ return self.wait_select_single("FeedListPage",
62 objectName="feedlistpage")
63
64 def get_articlelist_page(self):
65@@ -115,7 +91,7 @@
66 objectName="articlelistpage")
67
68 def get_feed_management_page(self):
69- return self.select_single_retry("TopicManagement",
70+ return self.wait_select_single("TopicManagement",
71 objectName="topicmanagement")
72
73 def get_edit_feed_page(self):
74@@ -126,7 +102,7 @@
75 return self.select_single("ManageTopicsPage")
76
77 def get_rss_feed_page(self):
78- return self.select_single_retry(
79+ return self.wait_select_single(
80 "RssFeedPage", objectName="rssfeedpage")
81
82 def get_topics(self):
83@@ -165,25 +141,25 @@
84 return self.select_single("ActionItem", text="Back")
85
86 def get_editfeed_done_button(self):
87- return self.select_single_retry("Button", objectName="doneButton")
88+ return self.wait_select_single("Button", objectName="doneButton")
89
90 def get_activityIndicator(self):
91- return self.select_single_retry(
92+ return self.wait_select_single(
93 "ActivityIndicator", objectName="activityindicator")
94
95 def get_topic_tab(self, topic):
96- return self.select_single_retry("TopicTab", title=topic)
97+ return self.wait_select_single("TopicTab", title=topic)
98
99 def get_feed_in_feedlist(self, topic, feed):
100 tab = self.get_topic_tab(topic)
101- itemList = tab.select_many("Subtitled", objectName="feedlistitems")
102+ itemList = tab.select_many("UbuntuShape", objectName="feedlistitems")
103 for item in itemList:
104- splititem = item.subText.split(",")
105- if splititem[1] == " " + feed:
106- return item
107+ label = item.select_single("Label", objectName="labelFeedname")
108+ if label.text == feed:
109+ return item
110
111 def get_editfeed_topic_valueselector(self):
112- return self.select_single_retry(
113+ return self.wait_select_single(
114 "ValueSelector", objectName="valueselector")
115
116 def get_editfeed_valueselector_value(self, name):
117
118=== modified file 'tests/autopilot/ubuntu_rssreader_app/tests/__init__.py'
119--- tests/autopilot/ubuntu_rssreader_app/tests/__init__.py 2013-10-07 12:49:31 +0000
120+++ tests/autopilot/ubuntu_rssreader_app/tests/__init__.py 2013-11-05 03:02:07 +0000
121@@ -28,7 +28,11 @@
122 from autopilot.platform import model
123 from autopilot.testcase import AutopilotTestCase
124
125-from ubuntuuitoolkit import emulators as toolkit_emulators
126+from ubuntuuitoolkit import (
127+ base,
128+ emulators as toolkit_emulators
129+)
130+
131 from ubuntu_rssreader_app import emulators
132
133 logger = logging.getLogger(__name__)
134@@ -74,14 +78,14 @@
135
136 def launch_test_local(self):
137 self.app = self.launch_test_application(
138- "qmlscene",
139+ base.get_qmlscene_launch_command(),
140 self.local_location,
141 app_type='qt',
142 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
143
144 def launch_test_installed(self):
145 self.app = self.launch_test_application(
146- "qmlscene",
147+ base.get_qmlscene_launch_command(),
148 self.installed_location,
149 "--desktop_file_hint=/usr/share/applications/"
150 "rssreader-app.desktop",
151
152=== modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py'
153--- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-10-10 18:12:28 +0000
154+++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-11-05 03:02:07 +0000
155@@ -145,13 +145,14 @@
156
157 #check topic
158 logger.debug("assert topic remains")
159- self.assertThat(lambda: self.main_view.get_feedlist_topic(topicName),
160- Eventually(Not(Is(None))))
161+ self.assertThat(
162+ self.main_view.get_feedlist_topic(topicName), Not(Is(None)))
163
164 #check feed has been removed
165 logger.debug("assert removed feed")
166- self.assertThat(lambda: self.main_view.get_feedlist_feed(feedName),
167- Eventually(Equals(None)))
168+ self.assertThat(
169+ lambda: self.main_view.select_many('FeedComponent', text=feedName),
170+ Eventually(Equals([])))
171
172 def _remove_topic(self, topicName):
173 self.assertThat(self.main_view.get_topics_page,
174@@ -360,9 +361,9 @@
175
176 #click on news topic
177 topicValueselectorValue = self.main_view. \
178- get_editfeed_valueselector_value("news")
179+ get_editfeed_valueselector_value("Ubuntu")
180 self.pointing_device.click_object(topicValueselectorValue)
181
182 #verify topic has changed
183 self.assertThat(topicValueselectorValue.text,
184- Eventually(Equals("news")))
185+ Eventually(Equals("Ubuntu")))

Subscribers

People subscribed via source and target branches