Merge lp:~carla-sella/ubuntu-rssreader-app/edit-topic-test into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Carla Sella
Status: Superseded
Proposed branch: lp:~carla-sella/ubuntu-rssreader-app/edit-topic-test
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 196 lines (+117/-18)
3 files modified
feeds/EditFeed.qml (+2/-0)
tests/autopilot/ubuntu_rssreader_app/emulators.py (+11/-6)
tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+104/-12)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-rssreader-app/edit-topic-test
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Nicholas Skaggs (community) Approve
Review via email: mp+190234@code.launchpad.net

This proposal has been superseded by a proposal from 2013-10-10.

Commit message

Autopilot edit topic test for ubuntu-rssreader-app.

Description of the change

Completed edit topic test.

To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

This works through multiple iterations just fine, fixes the current regressions due to UI changes, and adds a testcase :-)

review: Approve
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
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
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 'feeds/EditFeed.qml'
2--- feeds/EditFeed.qml 2013-10-07 13:42:07 +0000
3+++ feeds/EditFeed.qml 2013-10-09 20:05:58 +0000
4@@ -49,6 +49,7 @@
5 Button
6 {
7 id: btnApply
8+ objectName: "doneButton"
9 text: i18n.tr("Done")
10 gradient: UbuntuColors.orangeGradient
11 anchors.verticalCenter: parent.verticalCenter
12@@ -165,6 +166,7 @@
13 }
14
15 ListItem.ValueSelector {
16+ objectName: "valueselector"
17 id: seletorTopic
18 text: i18n.tr("Topic: ")
19 values: (topicArray == undefined || topicArray.length == 0) ? [""] : topicArray
20
21=== modified file 'tests/autopilot/ubuntu_rssreader_app/emulators.py'
22--- tests/autopilot/ubuntu_rssreader_app/emulators.py 2013-10-06 13:07:13 +0000
23+++ tests/autopilot/ubuntu_rssreader_app/emulators.py 2013-10-09 20:05:58 +0000
24@@ -156,6 +156,9 @@
25 def get_toolbar_back_button(self):
26 return self.select_single("ActionItem", text="Back")
27
28+ def get_editfeed_done_button(self):
29+ return self.select_single_retry("Button", objectName="doneButton")
30+
31 def get_activityIndicator(self):
32 return self.select_single_retry(
33 "ActivityIndicator", objectName="activityindicator")
34@@ -173,9 +176,11 @@
35 if splititem[1] == " Canonical":
36 return item
37
38- def get_page_back_btn(self):
39- back_btn = self.select_single(
40- "ToolbarItems", objectName="pageBackBtn")
41- back_btn_ActionItem = back_btn.select_single(
42- "ActionItem", text="Back")
43- return back_btn_ActionItem
44+ def get_editfeed_topic_valueselector(self):
45+ return self.select_single_retry(
46+ "ValueSelector", objectName="valueselector")
47+
48+ def get_editfeed_valueselector_value(self, name):
49+ valueselector = self.get_editfeed_topic_valueselector()
50+ return valueselector.select_single("LabelVisual", text=name)
51+
52
53=== modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py'
54--- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-10-07 20:50:09 +0000
55+++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-10-09 20:05:58 +0000
56@@ -126,9 +126,6 @@
57 logger.debug("grabbing feed")
58 feed = self.main_view.get_feedlist_feed(feedName)
59
60-
61-
62-
63 self.assertThat(
64 self.main_view.get_feed_management_page,
65 Eventually(NotEquals(None)))
66@@ -143,14 +140,6 @@
67 #self.pointing_device.click()
68 self.pointing_device.drag(startX, lineY, stopX, lineY)
69
70-
71-
72-
73-
74-
75-
76-
77-
78 #logger.debug("clicking feed")
79 #self.pointing_device.click_object(feed)
80
81@@ -338,7 +327,7 @@
82 toolbar = self.main_view.open_toolbar()
83
84 #click on back toolbar button
85- rssfeedpageBackBtn = self.main_view.get_page_back_btn()
86+ rssfeedpageBackBtn = self.main_view.get_toolbar_back_button()
87 self.pointing_device.click_object(rssfeedpageBackBtn)
88
89 #verify we are on the CanonicalTopic Tab
90@@ -350,3 +339,106 @@
91
92 #remove added Canonical topic
93 self._remove_topic(topicName)
94+
95+ def test_edit_topic(self):
96+ """test edit topic"""
97+
98+ feed = "http://www.canonical.com/rss.xml"
99+ feedName = "Canonical"
100+ topicName = "CanonicalTopic"
101+
102+ #add topic and feed
103+ self._add_feed_and_topic(feed, topicName)
104+
105+ #verify we are on the CanonicalTopic Tab
106+ canonicalTab = self.main_view.get_canonical_tab()
107+ self.assertThat(canonicalTab.visible, Eventually(Equals(True)))
108+
109+ #open toolbar
110+ toolbar = self.main_view.open_toolbar()
111+
112+ #click on edit topics button
113+ toolbar.click_button("edittopicsbutton")
114+
115+ # verify we are on topic management page
116+ topicmanagementpage = self.main_view.get_feed_management_page()
117+ self.assertThat(
118+ topicmanagementpage.objectName,
119+ Eventually(Equals("topicmanagement")))
120+
121+ #verity Canonical Tab is expanded
122+ canonicaltopic = self.main_view.get_feedlist_topic(topicName)
123+ if canonicaltopic.state != "expended":
124+ self.pointing_device.click_object(canonicaltopic)
125+
126+ #select Canonical feed
127+ canonicalFeed = self.main_view.get_feedlist_feed(feedName)
128+ self.assertThat(canonicalFeed, NotEquals(None))
129+ self.pointing_device.click_object(canonicalFeed)
130+
131+ #verify we are on edit feed page
132+ editfeedpage = self.main_view.get_edit_feed_page()
133+ self.assertThat(editfeedpage.visible, Eventually(Equals(True)))
134+
135+ #change topic from dropdown
136+ topicValueselector = self.main_view.get_editfeed_topic_valueselector()
137+ self.pointing_device.click_object(topicValueselector)
138+
139+ #click on news topic
140+ topicValueselectorValue=self.main_view.get_editfeed_valueselector_value("news")
141+ self.pointing_device.click_object(topicValueselectorValue)
142+
143+ #verify topic has changed
144+ self.assertThat(topicValueselectorValue.text, Eventually(Equals("news")))
145+
146+ #open toolbar
147+ toolbar = self.main_view.open_toolbar()
148+
149+ #click on done button
150+ editfeedpageDoneButton = self.main_view.get_editfeed_done_button()
151+ self.pointing_device.click_object(editfeedpageDoneButton)
152+
153+ ##select Canonical feed again
154+ canonicalFeed = self.main_view.get_feedlist_feed(feedName)
155+ self.assertFalse(not canonicalFeed)
156+ self.pointing_device.click_object(canonicalFeed)
157+
158+ #verify we are on edit feed page
159+ editfeedpage = self.main_view.get_edit_feed_page()
160+ self.assertFalse(not editfeedpage)
161+
162+ #change topic from dropdown
163+ topicValueselector = self.main_view.get_editfeed_topic_valueselector()
164+ self.pointing_device.click_object(topicValueselector)
165+
166+ #click on news topic
167+ topicValueselectorValue=self.main_view.get_editfeed_valueselector_value("CanonicalTopic")
168+ self.pointing_device.click_object(topicValueselectorValue)
169+
170+ #verify topic has changed
171+ self.assertThat(topicValueselectorValue.text, Eventually(Equals(("CanonicalTopic"))))
172+
173+ #open toolbar
174+ toolbar = self.main_view.open_toolbar()
175+
176+ #click on done button
177+ editfeedpageDoneButton = self.main_view.get_editfeed_done_button()
178+ self.pointing_device.click_object(editfeedpageDoneButton)
179+
180+ #verify we are on the CanonicalTopic Tab
181+ canonicalTab = self.main_view.get_canonical_tab()
182+ self.assertFalse(not canonicalTab)
183+
184+ #open toolbar
185+ toolbar = self.main_view.open_toolbar()
186+
187+ #click on back toolbar Button
188+ backButton = self.main_view.get_toolbar_back_button()
189+ self.pointing_device.click_object(backButton)
190+
191+ #remove added Canonical feed
192+ self._remove_feed(feedName, topicName)
193+
194+ #remove added Canonical topic
195+ self._remove_topic(topicName)
196+

Subscribers

People subscribed via source and target branches