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
Prerequisite: lp:~elopio/ubuntu-rssreader-app/update_autopilot_tests
Diff against target: 154 lines (+20/-39)
3 files modified
tests/autopilot/ubuntu_rssreader_app/emulators.py (+8/-32)
tests/autopilot/ubuntu_rssreader_app/tests/__init__.py (+7/-3)
tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+5/-4)
To merge this branch: bzr merge lp:~elopio/ubuntu-rssreader-app/autopilot-1.4
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Thomi Richards Pending
Ubuntu Shorts Developers Pending
Review via email: mp+193874@code.launchpad.net

This proposal supersedes a proposal from 2013-10-30.

Commit message

Updated autopilot tests for version 1.4.

Description of the change

With the prerequisite branch, now all three tests pass.

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

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

Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

LGTM. Do not approve until AP 1.4 lands.

review: Approve
Revision history for this message
Joey Chan (qqworini) wrote :

So .. can I approve it now ?

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

No, tomorrow we will be ready :)

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote : Posted in a previous version of this proposal

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.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

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

Subscribers

People subscribed via source and target branches