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

Proposed by Carla Sella on 2014-12-28
Status: Merged
Approved by: Nicholas Skaggs on 2015-01-21
Approved revision: 361
Merged at revision: 355
Proposed branch: lp:~carla-sella/ubuntu-rssreader-app/fixed-test-edit-topic
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Prerequisite: lp:~carla-sella/ubuntu-rssreader-app/fixed-tests-for-feed-checkbox
Diff against target: 447 lines (+121/-117)
5 files modified
feeds/EditFeedPage.qml (+1/-0)
po/com.ubuntu.shorts.pot (+33/-37)
shorts-app.qml (+1/-0)
tests/autopilot/shorts_app/__init__.py (+68/-34)
tests/autopilot/shorts_app/tests/test_rssreader.py (+18/-46)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-rssreader-app/fixed-test-edit-topic
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-01-20
Nicholas Skaggs 2014-12-28 Approve on 2015-01-20
Roman Shchekin 2015-01-18 Approve on 2015-01-18
Review via email: mp+245411@code.launchpad.net

Commit Message

Autopilot tests for Ubuntu Rssreader App

Description of the Change

Fixing test test_edit_topic.

To post a comment you must log in.
Carla Sella (carla-sella) wrote :

Have to add assert that changes have worked.

Carla Sella (carla-sella) wrote :

Looks like editing feeds does not work.

Roman Shchekin (mrqtros) wrote :

Strange, I think that currently all features work well in trunk.

Carla Sella (carla-sella) wrote :

I tried both with: shorts-app from my desktop and "autopilot3 launch -i Qt qmlscene ../../shorts-app.qml" from test/autopilot directory of ubuntu-rssreader-app on my dekstop, but I am unable to edit feeds.
From "Edit topics" I am unable to change a feeds title, URL and topic.

Joey Chan (qqworini) wrote :

Only the topic can be changed in the "edit feed" page

Carla Sella (carla-sella) wrote :

@ Joey: Thanks for the info. But I tried to change topic to a new topic and feed I inserted into shorts but the topic does not change, when you exit the edit feed page and enter the edit feed page again, the previous feed that I changed the topic, has the same previous topic before the change.
Unless I am doing something wrong.

352. By Carla Sella on 2015-01-06

Autopilot tests for Ubuntu Rssreader App.

Approved by Ubuntu Phone Apps Jenkins Bot.

Carla Sella (carla-sella) wrote :

This is working after merging trunk.

Carla Sella (carla-sella) wrote :

No, wait, editing a topic still does not work.

Carla Sella (carla-sella) wrote :

I reported bug #1408455 as I am unable to change feed's topic.

Nicholas Skaggs (nskaggs) wrote :

Carla, can you fix the pep8 errors in this so the jenkins run shows properly?

review: Needs Fixing
353. By Carla Sella on 2015-01-08

Completed test but skipped it due to bug #1408455.

Carla Sella (carla-sella) wrote :

Nicholas, I skipped the test because of bug #1408455.

Carla Sella (carla-sella) wrote :

Oh and I fixed pep8 errors.

Carla Sella (carla-sella) wrote :

Unless you want me to keep the test without the final assertion, let me know.

Nicholas Skaggs (nskaggs) wrote :

I would not skip the test; we can use that to confirm the bug is fixed :-) Left a comment.

354. By Carla Sella on 2015-01-10

Deleted skipping of edit feed's topic test and fixed got to edit feeds code.

Carla Sella (carla-sella) wrote :

Test should be ok now.

355. By Carla Sella on 2015-01-12

Fixed two errors in two ShortsTestCaseWithTopicAndFeed tests.

Carla Sella (carla-sella) wrote :

This failure will occur until bug #1408455 is fixed.
So the mp should be complete now.

Joey Chan (qqworini) wrote :

@Carla, I'm busy this week, sorry for keep u waiting

Roman Shchekin (mrqtros) wrote :

I'll take a look soon.

Roman Shchekin (mrqtros) wrote :

Lol, toolbar with "Done" button just missing, I don't know why...
I will put 'Done' button to the header, ok?

Roman Shchekin (mrqtros) wrote :

Bug #1408455 fixed, Carla :)

Roman Shchekin (mrqtros) wrote :

But implementation is little bit different, you should run it test it by hand first!

Carla Sella (carla-sella) wrote :

Ok I will test it this evening.
Thanks.

Carla Sella
email: carla-sella@u <email address hidden>buntu.com
h <https://launchpad.net/%7Ecarla-sella>ttp://about.me/carla.sella
https://wiki.ubuntu.com/QATeam/

On Wed, Jan 14, 2015 at 6:47 AM, Roman Shchekin <email address hidden> wrote:

> But implementation is little bit different, you should run it test it by
> hand first!
> --
>
> https://code.launchpad.net/~carla-sella/ubuntu-rssreader-app/fixed-test-edit-topic/+merge/245411
> You are the owner of
> lp:~carla-sella/ubuntu-rssreader-app/fixed-test-edit-topic.
>

Roman Shchekin (mrqtros) wrote :

Another test fails...
Btw, Carla, how do you make merge with trunk without new comment in this discussion?

Carla Sella (carla-sella) wrote :

I usually do:
bzr merge lp:ubuntu-rssreader-app

356. By Carla Sella on 2015-01-14

Merged trunk and fixed some errors. Error due to bug #1408455 is still there.

357. By Carla Sella on 2015-01-17

Fixed clicking on done button in edit feed page.

358. By Carla Sella on 2015-01-17

Fixed clicking on new topic in edit feed page.

359. By Carla Sella on 2015-01-17

Second try fixing feed topic change.

Carla Sella (carla-sella) wrote :

This should be ready for merging now :-P.

Roman Shchekin (mrqtros) wrote :

Only Nick can review this?

Carla Sella (carla-sella) wrote :

Not sure, anyway I can add you too as a reviewer :).

Roman Shchekin (mrqtros) wrote :

Looks good for me :)

review: Approve
Nicholas Skaggs (nskaggs) wrote :

I approve, but I left a comment if you could address it.

review: Approve
360. By Carla Sella on 2015-01-20

Added bug no. for click_edit_topics_in_header issue.

361. By Carla Sella on 2015-01-20

Added other comment for bug 1412967.

Carla Sella (carla-sella) wrote :

Nicholas, I added two comments for bug #1412967.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'feeds/EditFeedPage.qml'
2--- feeds/EditFeedPage.qml 2015-01-13 17:02:05 +0000
3+++ feeds/EditFeedPage.qml 2015-01-20 21:28:37 +0000
4@@ -15,6 +15,7 @@
5
6 head.actions: [
7 Action {
8+ objectName: "doneButton"
9 iconName: "ok"
10 text: i18n.tr("Done")
11 onTriggered: {
12
13=== modified file 'po/com.ubuntu.shorts.pot'
14--- po/com.ubuntu.shorts.pot 2014-09-25 09:45:16 +0000
15+++ po/com.ubuntu.shorts.pot 2015-01-20 21:28:37 +0000
16@@ -8,7 +8,7 @@
17 msgstr ""
18 "Project-Id-Version: \n"
19 "Report-Msgid-Bugs-To: \n"
20-"POT-Creation-Date: 2014-09-25 11:45+0200\n"
21+"POT-Creation-Date: 2014-12-26 17:02+0100\n"
22 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
23 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
24 "Language-Team: LANGUAGE <LL@li.org>\n"
25@@ -22,27 +22,6 @@
26 msgid "Select article"
27 msgstr ""
28
29-#: ../ArticleViewItem.qml:261
30-msgid "Back"
31-msgstr ""
32-
33-#: ../ArticleViewItem.qml:278
34-msgid "Options"
35-msgstr ""
36-
37-#: ../ArticleViewItem.qml:296
38-msgid "Save"
39-msgstr ""
40-
41-#: ../ArticleViewItem.qml:296 ../feeds/SwipeDelete.qml:57
42-#: ../feeds/SwipeDelete.qml:76
43-msgid "Remove"
44-msgstr ""
45-
46-#: ../ArticleViewItem.qml:322
47-msgid "Open site"
48-msgstr ""
49-
50 #: ../ReadingOptions.qml:44
51 msgid "Dark"
52 msgstr ""
53@@ -63,6 +42,23 @@
54 msgid "Large"
55 msgstr ""
56
57+#: ../RssFeedPage.qml:48
58+msgid "Options"
59+msgstr ""
60+
61+#: ../RssFeedPage.qml:56
62+msgid "Save"
63+msgstr ""
64+
65+#: ../RssFeedPage.qml:56 ../feeds/SwipeDelete.qml:57
66+#: ../feeds/SwipeDelete.qml:76
67+msgid "Remove"
68+msgstr ""
69+
70+#: ../RssFeedPage.qml:72
71+msgid "Open site"
72+msgstr ""
73+
74 #: ../SavedTab.qml:190
75 msgid "You have no saved articles"
76 msgstr ""
77@@ -119,7 +115,7 @@
78 msgstr[0] ""
79 msgstr[1] ""
80
81-#: ../feeds/AppendFeedPage.qml:30 ../shorts-app.qml:249 ../shorts-app.qml:440
82+#: ../feeds/AppendFeedPage.qml:30 ../shorts-app.qml:249 ../shorts-app.qml:441
83 msgid "Add feeds"
84 msgstr ""
85
86@@ -145,7 +141,7 @@
87
88 #: ../feeds/AppendFeedPage.qml:242 ../feeds/CreateTopicPage.qml:38
89 #: ../feeds/EditFeed.qml:24 ../feeds/TopicManagement.qml:64
90-#: ../shorts-app.qml:499
91+#: ../shorts-app.qml:500
92 msgid "Cancel"
93 msgstr ""
94
95@@ -222,7 +218,7 @@
96 msgid "Topic: "
97 msgstr ""
98
99-#: ../feeds/TopicManagement.qml:13 ../shorts-app.qml:262
100+#: ../feeds/TopicManagement.qml:13 ../shorts-app.qml:263
101 msgid "Edit topics"
102 msgstr ""
103
104@@ -246,51 +242,51 @@
105 msgid "List view"
106 msgstr ""
107
108-#: ../shorts-app.qml:367
109+#: ../shorts-app.qml:368
110 msgid "Saved"
111 msgstr ""
112
113-#: ../shorts-app.qml:375 com.ubuntu.shorts_shorts.desktop.in.in.h:1
114+#: ../shorts-app.qml:376 com.ubuntu.shorts_shorts.desktop.in.in.h:1
115 msgid "Shorts"
116 msgstr ""
117
118-#: ../shorts-app.qml:491
119+#: ../shorts-app.qml:492
120 msgid "Checking for new articles"
121 msgstr ""
122
123-#: ../shorts-app.qml:515
124+#: ../shorts-app.qml:516
125 msgid "Perhaps some of the channels have not been updated."
126 msgstr ""
127
128-#: ../shorts-app.qml:516
129+#: ../shorts-app.qml:517
130 msgid "Errors occurred during the update"
131 msgstr ""
132
133-#: ../shorts-app.qml:534
134+#: ../shorts-app.qml:535
135 msgid "+ Add feeds"
136 msgstr ""
137
138-#: ../shorts-app.qml:554
139+#: ../shorts-app.qml:555
140 msgid "Add online accounts"
141 msgstr ""
142
143-#: ../shorts-app.qml:557
144+#: ../shorts-app.qml:558
145 msgid "Online accounts are not available for now"
146 msgstr ""
147
148-#: ../shorts-app.qml:558 ../shorts-app.qml:567
149+#: ../shorts-app.qml:559 ../shorts-app.qml:568
150 msgid "We are sorry"
151 msgstr ""
152
153-#: ../shorts-app.qml:563
154+#: ../shorts-app.qml:564
155 msgid "Import subscriptions"
156 msgstr ""
157
158-#: ../shorts-app.qml:566
159+#: ../shorts-app.qml:567
160 msgid "Importing subscriptions is not available for now"
161 msgstr ""
162
163-#: ../shorts-app.qml:581
164+#: ../shorts-app.qml:582
165 msgid "Ok"
166 msgstr ""
167
168
169=== modified file 'shorts-app.qml'
170--- shorts-app.qml 2015-01-13 16:56:27 +0000
171+++ shorts-app.qml 2015-01-20 21:28:37 +0000
172@@ -259,6 +259,7 @@
173
174 Action {
175 id: editTopicsAction
176+ objectName:"editTopicsAction"
177 text: i18n.tr("Edit topics")
178 iconSource: Qt.resolvedUrl("./icons_tmp/edit.svg")
179 onTriggered: {
180
181=== modified file 'tests/autopilot/shorts_app/__init__.py'
182--- tests/autopilot/shorts_app/__init__.py 2014-12-21 20:56:23 +0000
183+++ tests/autopilot/shorts_app/__init__.py 2015-01-20 21:28:37 +0000
184@@ -50,24 +50,8 @@
185 return self.wait_select_single(AppendFeedPage)
186
187 @autopilot_logging.log_action(logger.info)
188- def go_to_edit_feeds(self):
189+ def get_edit_feeds_page(self):
190 """Go to the edit feeds page."""
191- # does not work using workaround
192- # header = self.get_header()
193- # header.click_action_button('Edit topics')
194-
195- # -------------------------------------------------------------------
196- # this will have to bee removed after fixing above header issue
197- actionsButton = self.wait_select_single(
198- "PageHeadButton", objectName='actions_overflow_button')
199- self.pointing_device.click_object(actionsButton)
200- popover = self.wait_select_single(
201- "StyledItem", objectName="popover_foreground")
202- addReadsAction = popover.wait_select_single(
203- "AbstractButton", text="Edit topics")
204- self.pointing_device.click_object(addReadsAction)
205- # -----------------------------------------------------------------
206-
207 return self.wait_select_single(
208 TopicManagement, objectName='topicmanagement')
209
210@@ -146,12 +130,6 @@
211 return self.select_single("Button", objectName="nextButton")
212
213 # feed list page objects
214- def get_feedlist_topic(self, name):
215- return self.wait_select_single("TopicComponent", topicName=name)
216-
217- def get_feedlist_feed(self, feed):
218- return self.wait_select_single("FeedComponent", text=feed)
219-
220 def get_add_a_topic(self):
221 return self.select_single("QQuickItem", objectName="addTopic")
222
223@@ -173,7 +151,7 @@
224 objectName="topicmanagement")
225
226 def get_edit_feed_page(self):
227- return self.select_single("EditFeed",
228+ return self.select_single("EditFeedPage",
229 objectName="editfeedpage")
230
231 def get_manage_topics_page(self):
232@@ -262,14 +240,6 @@
233 if flickable.focus:
234 return flickable
235
236- def get_editfeed_topic_valueselector(self):
237- return self.wait_select_single(
238- "ValueSelector", objectName="valueselector")
239-
240- def get_editfeed_valueselector_value(self, name):
241- valueselector = self.get_editfeed_topic_valueselector()
242- return valueselector.select_single("LabelVisual", text=name)
243-
244 @autopilot_logging.log_action(logger.info)
245 def change_view_mode(self, mode):
246 """Change view mode.
247@@ -304,6 +274,43 @@
248 self.pointing_device.click_object(addReadsAction)
249 # -----------------------------------------------------------------
250
251+ @autopilot_logging.log_action(logger.info)
252+ def click_edit_topics_in_header(self):
253+ """
254+ does not work using workaround
255+ header = self.get_header()
256+ header.click_action_button('editTopicsAction')
257+ """
258+ # -------------------------------------------------------------------
259+ # this will have to bee removed after fixing above header issue
260+ # reported bug #1412967 -- 20/01/2015
261+ actionsButton = self.wait_select_single(
262+ "PageHeadButton", objectName='actions_overflow_button')
263+ self.pointing_device.click_object(actionsButton)
264+ popover = self.wait_select_single(
265+ "StyledItem", objectName="popover_foreground")
266+ addReadsAction = popover.wait_select_single(
267+ "AbstractButton", text="Edit topics")
268+
269+ self.pointing_device.click_object(addReadsAction)
270+ # -----------------------------------------------------------------
271+
272+ @autopilot_logging.log_action(logger.info)
273+ def click_header_done_button(self):
274+ """
275+ does not work using workaround
276+
277+ header = self.get_header()
278+ header.click_action_button("doneButton")
279+
280+ """
281+ # -------------------------------------------------------------------
282+ # this will have to bee removed after fixing above header issue
283+ # reported bug #1412967 -- 20/01/2015
284+ actionsButton = self.wait_select_single(
285+ "PageHeadButton", objectName='doneButton_header_button')
286+ self.pointing_device.click_object(actionsButton)
287+
288
289 class Page(toolkit_emulators.MainView):
290
291@@ -408,8 +415,7 @@
292 topic_component.isExpanded.wait_for(False)
293
294 def _get_topic_component(self, topic_name):
295- return self.select_single(
296- TopicComponent, topicName=topic_name)
297+ return self.wait_select_single(TopicComponent, topicName=topic_name)
298
299 @autopilot_logging.log_action(logger.info)
300 def delete_topic(self, topic_name):
301@@ -462,6 +468,14 @@
302 else:
303 raise ShortsAppException('The topic is not expanded.')
304
305+ @autopilot_logging.log_action(logger.info)
306+ def goto_feed_in_topic(self, test_topic, test_feed_title):
307+ """Return the feed passed as argument. """
308+ topic_component = self.wait_select_single(
309+ TopicComponent, topicName=test_topic)
310+ self.pointing_device.click_object(topic_component.select_single(
311+ FeedComponent, text=test_feed_title))
312+
313 def get_topics(self):
314 """Return the list of the topics available.
315
316@@ -477,6 +491,26 @@
317 return topics
318
319
320+class EditFeedPage(Page):
321+
322+ """Autopilot helper for the Edit Feed page."""
323+ @autopilot_logging.log_action(logger.info)
324+ def change_feeds_topic(self, name):
325+ """ change feed's topic """
326+ topicValueselector = self._get_editfeed_topic_valueselector()
327+ self.pointing_device.click_object(topicValueselector)
328+ newTopic = self._get_editfeed_valueselector_value(
329+ topicValueselector, name)
330+ self.pointing_device.click_object(newTopic)
331+
332+ def _get_editfeed_topic_valueselector(self):
333+ return self.wait_select_single(
334+ "ValueSelector", objectName="valueselector")
335+
336+ def _get_editfeed_valueselector_value(self, topicValueselector, name):
337+ return topicValueselector.wait_select_single("LabelVisual", text=name)
338+
339+
340 class FeedComponent(toolkit_emulators.Empty):
341
342 """Autopilot helper for the Feed Component list item."""
343
344=== modified file 'tests/autopilot/shorts_app/tests/test_rssreader.py'
345--- tests/autopilot/shorts_app/tests/test_rssreader.py 2014-12-16 19:51:03 +0000
346+++ tests/autopilot/shorts_app/tests/test_rssreader.py 2015-01-20 21:28:37 +0000
347@@ -20,7 +20,6 @@
348 from testtools.matchers import Equals, NotEquals
349
350 from shorts_app.tests import ShortsAppTestCase
351-import unittest
352 import logging
353
354 logger = logging.getLogger(__name__)
355@@ -116,7 +115,6 @@
356 test_topic, test_feed_title),
357 self.app.main_view.get_articleviewitem_title())
358
359- @unittest.skip("Can't see or get dynamic tabs")
360 def test_edit_topic(self):
361 """test edit topic"""
362 test_feed_url = _EXTERNAL_FEED_URL
363@@ -125,50 +123,22 @@
364
365 self.add_feed_to_new_topic(test_feed_url, test_feed_title, test_topic)
366
367- # verify we are on the topicName Tab
368- editTab = self.app.main_view.get_topic_tab(test_topic)
369- self.assertThat(editTab.visible, Eventually(Equals(True)))
370-
371- # open toolbar
372- toolbar = self.app.main_view.open_toolbar()
373-
374- # click on edit topics button
375- toolbar.click_button("edittopicsbutton")
376-
377- # verify we are on topic management page
378- topicmanagementpage = \
379- self.app.main_view.get_feed_management_page()
380- self.assertThat(
381- topicmanagementpage.objectName,
382- Eventually(Equals("topicmanagement")))
383-
384- # verity Tab is expanded
385- editTopic = self.app.main_view.get_feedlist_topic(test_topic)
386- if editTopic.state != "expanded":
387- self.pointing_device.click_object(editTopic)
388-
389- # select feed
390- editFeed = self.app.main_view.get_feedlist_feed(test_topic)
391- self.assertThat(editFeed, NotEquals(None))
392- self.pointing_device.click_object(editFeed)
393-
394- # verify we are on edit feed page
395- editfeedpage = self.app.main_view.get_edit_feed_page()
396- self.assertThat(editfeedpage.visible, Eventually(Equals(True)))
397-
398- # change topic from dropdown
399- topicValueselector = \
400- self.app.main_view.get_editfeed_topic_valueselector()
401- self.pointing_device.click_object(topicValueselector)
402-
403- # click on news topic
404- topicValueselectorValue = self.app.main_view. \
405- get_editfeed_valueselector_value("Ubuntu")
406- self.pointing_device.click_object(topicValueselectorValue)
407+ self.app.main_view.click_edit_topics_in_header()
408+ topicManagementPage = self.app.main_view.get_feed_management_page()
409+ topicManagementPage.expand_topic(test_topic)
410+
411+ # change feed's topic
412+ topicManagementPage.goto_feed_in_topic(test_topic, test_feed_title)
413+ editFeedpage = self.app.main_view.get_edit_feed_page()
414+ editFeedpage.change_feeds_topic("Ubuntu")
415+ self.app.main_view.click_header_done_button()
416
417 # verify topic has changed
418- self.assertThat(topicValueselectorValue.text,
419- Eventually(Equals("Ubuntu")))
420+ newTopic = topicManagementPage.wait_select_single(
421+ "TopicComponent", topicName="Ubuntu")
422+ self.assertThat(newTopic.wait_select_single(
423+ "FeedComponent", text=test_feed_title).text,
424+ Eventually(Equals(test_feed_title)))
425
426
427 class ShortsTestCaseWithTopicAndFeed(BaseShortsAppTestCase):
428@@ -183,7 +153,8 @@
429
430 def test_remove_feed(self):
431 """Test the removal of a feed from the Edit Feeds page."""
432- edit_feeds_page = self.app.main_view.go_to_edit_feeds()
433+ self.app.main_view.click_edit_topics_in_header()
434+ edit_feeds_page = self.app.main_view.get_edit_feeds_page()
435 edit_feeds_page.expand_topic(self.test_topic)
436 feeds = edit_feeds_page.get_feeds_in_topic(self.test_topic)
437 self.assertIn(self.test_feed_title, feeds)
438@@ -193,7 +164,8 @@
439
440 def test_remove_topic(self):
441 """Test the removal of a topic from the Edit Topics page."""
442- edit_feeds_page = self.app.main_view.go_to_edit_feeds()
443+ self.app.main_view.click_edit_topics_in_header()
444+ edit_feeds_page = self.app.main_view.get_edit_feeds_page()
445 edit_feeds_page.delete_topic(self.test_topic)
446 topics = edit_feeds_page.get_topics()
447 self.assertNotIn(self.test_topic, topics)

Subscribers

People subscribed via source and target branches