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

Proposed by Carla Sella
Status: Superseded
Proposed branch: lp:~carla-sella/ubuntu-rssreader-app/view-feeds-test
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 491 lines (+246/-64)
9 files modified
feeds/AppendFeedPage.qml (+1/-1)
feeds/ChooseTopicPage.qml (+2/-1)
feeds/EditFeed.qml (+2/-1)
feeds/ManageFeedsPage.qml (+1/-0)
feeds/TopicManagement.qml (+2/-0)
listview/ArticleListPage.qml (+1/-1)
listview/FeedListPage.qml (+1/-1)
tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py (+20/-4)
tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py (+216/-55)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-rssreader-app/view-feeds-test
Reviewer Review Type Date Requested Status
Ubuntu Shorts Developers Pending
Review via email: mp+178470@code.launchpad.net

This proposal has been superseded by a proposal from 2013-08-13.

Commit message

autopilot ubuntu-rssreader-app view feed test

Description of the change

Completed view all feeds an view feed test.

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

A quick glance at this, I don't see anything that jumps out at me. I'll do a better review tomorrow if it's not merged by then ;-)

30. By Roman Shchekin

A lot of little fixes of careless mistakes.

Approved by Ubuntu Phone Apps Jenkins Bot, Joey Chan.

31. By Roman Shchekin

ListModePage.qml now can display concrete topic too.

Approved by Ubuntu Phone Apps Jenkins Bot.

32. By Roman Shchekin

Added dialog for "Refresh" operation!.

Approved by Ubuntu Phone Apps Jenkins Bot.

33. By Roman Shchekin

Debian package fix (icons included).

Approved by Ubuntu Phone Apps Jenkins Bot.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Converting this to the emulator and rebasing to upstream trunk

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Looks good Carla, plenty of asserts in here to make sure timing doesn't bite you :-) Having all those asserts to check each step is really good. A couple things to note;

As you know English strings break things when we run in other languages, like Italian ;-) So, use the .visible property to ensure your on the proper page rather than the page title. This won't break when they rename the pages either! No need to check the title if we got the object (page) and it's visible.

We can also assert when things like text entry boxes come into focus via the .focus property. Pretty handy to make sure our text entry goes in the proper place :-)

These little things could cause issues when run on the devices, but likely doesn't effect the desktop runs, so it doesn't come up while writing.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

One other thing, the proper syntax for a lambda function within an assert is;

self.assertThat(lambda: checkboxBtn, Eventually(NotEquals(None)))

In some cases there were a few that looked like this:

lambda: self.assertThat(checkboxBtn, Eventually(NotEquals(None)))

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

This is equivalent

    def get_canonical_feed_labelvisual(self):
        itemList = self.select_many('LabelVisual', text = 'Canonical')
        for item in itemList:
            if item.text == "Canonical":
                return item

to this:

    def get_canonical_feed_labelvisual(self):
        itemList = self.app.select_many('LabelVisual', text = 'Canonical')
        index = -1
        for item in itemList:
            index += 1
            if item.text == "Canonical":
               return itemList[index]

See the difference? You can use item directly as it's equal to itemList[index].

34. By Nicholas Skaggs

merge carla's changes, plus initial conversion to sdk emulator

35. By Nicholas Skaggs

first working version

36. By Nicholas Skaggs

cleaned up comments, etc

37. By Nicholas Skaggs

Tweak autopilot tests, force new build into ppa.

Approved by Ubuntu Phone Apps Jenkins Bot.

38. By Nicholas Skaggs

Tweak autopilot tests, force new build into ppa.

Approved by Ubuntu Phone Apps Jenkins Bot.

39. By Nicholas Skaggs

Small cleanups for dependencies.

Approved by Ubuntu Phone Apps Jenkins Bot.

40. By Carla Sella

Autopilot view feed test needs review.

Unmerged revisions

40. By Carla Sella

Autopilot view feed test needs review.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'feeds/AppendFeedPage.qml'
--- feeds/AppendFeedPage.qml 2013-08-02 19:00:56 +0000
+++ feeds/AppendFeedPage.qml 2013-08-12 19:46:20 +0000
@@ -9,7 +9,7 @@
99
10Page {10Page {
11 id: appendFeedPage11 id: appendFeedPage
1212 objectName: "appendfeedpage"
13 title: "Append feed"13 title: "Append feed"
14 flickable: null14 flickable: null
15 visible: false15 visible: false
1616
=== modified file 'feeds/ChooseTopicPage.qml'
--- feeds/ChooseTopicPage.qml 2013-08-04 08:51:35 +0000
+++ feeds/ChooseTopicPage.qml 2013-08-12 19:46:20 +0000
@@ -8,7 +8,7 @@
88
9Page {9Page {
10 id: chooseTopicPage10 id: chooseTopicPage
1111 objectName: "choosetopicpage"
12 title: "Choose topic"12 title: "Choose topic"
13 flickable: null13 flickable: null
14 visible: false14 visible: false
@@ -101,6 +101,7 @@
101 }101 }
102102
103 delegate: ListItem.Standard {103 delegate: ListItem.Standard {
104 objectName: "topicItem"
104 text: model.tagName105 text: model.tagName
105106
106 onClicked: {107 onClicked: {
107108
=== modified file 'feeds/EditFeed.qml'
--- feeds/EditFeed.qml 2013-08-03 10:06:36 +0000
+++ feeds/EditFeed.qml 2013-08-12 19:46:20 +0000
@@ -8,7 +8,7 @@
88
9Page {9Page {
10 id: editPage10 id: editPage
1111 objectName: "editfeedpage"
12 title: i18n.tr("Edit Feed")12 title: i18n.tr("Edit Feed")
13 flickable: null/*content*/13 flickable: null/*content*/
14 tools: ToolbarItems {14 tools: ToolbarItems {
@@ -27,6 +27,7 @@
27 Button27 Button
28 {28 {
29 id: btnDelete29 id: btnDelete
30 objectName: "deleteButton"
30 text: i18n.tr("Delete")31 text: i18n.tr("Delete")
31 gradient: UbuntuColors.orangeGradient32 gradient: UbuntuColors.orangeGradient
32 anchors.verticalCenter: parent.verticalCenter33 anchors.verticalCenter: parent.verticalCenter
3334
=== modified file 'feeds/ManageFeedsPage.qml'
--- feeds/ManageFeedsPage.qml 2013-08-03 14:21:20 +0000
+++ feeds/ManageFeedsPage.qml 2013-08-12 19:46:20 +0000
@@ -8,6 +8,7 @@
88
9Page {9Page {
10 id: editFeedsPageRoot10 id: editFeedsPageRoot
11 objectName: "editfeedspage"
11 flickable: null12 flickable: null
12 title: i18n.tr("Feeds")13 title: i18n.tr("Feeds")
1314
1415
=== modified file 'feeds/TopicManagement.qml'
--- feeds/TopicManagement.qml 2013-08-03 10:06:36 +0000
+++ feeds/TopicManagement.qml 2013-08-12 19:46:20 +0000
@@ -7,6 +7,7 @@
7import "../databasemodule_v2.js" as DB7import "../databasemodule_v2.js" as DB
88
9Page {9Page {
10 objectName: "topicmanagement"
10 id: topicManagement11 id: topicManagement
1112
12// width: units.gu(50)13// width: units.gu(50)
@@ -69,6 +70,7 @@
6970
70 Item {71 Item {
71 id: itemAddTopic72 id: itemAddTopic
73 objectName: "addTopic"
72 anchors{ left: parent.left; right: parent.right }74 anchors{ left: parent.left; right: parent.right }
73 height: units.gu(8)75 height: units.gu(8)
7476
7577
=== modified file 'listview/ArticleListPage.qml'
--- listview/ArticleListPage.qml 2013-07-29 18:31:05 +0000
+++ listview/ArticleListPage.qml 2013-08-12 19:46:20 +0000
@@ -8,7 +8,7 @@
8import "../databasemodule_v2.js" as DB8import "../databasemodule_v2.js" as DB
99
10Page {10Page {
1111 objectName: "articlelistpage"
12 signal articleSelected(var data) // mb id.12 signal articleSelected(var data) // mb id.
13 property var updateData: null13 property var updateData: null
1414
1515
=== modified file 'listview/FeedListPage.qml'
--- listview/FeedListPage.qml 2013-08-07 18:09:21 +0000
+++ listview/FeedListPage.qml 2013-08-12 19:46:20 +0000
@@ -10,7 +10,7 @@
1010
11Page {11Page {
12 id: pageItself12 id: pageItself
1313 objectName: "feedlistpage"
14 property var updatingFeed: null14 property var updatingFeed: null
15 property bool isDirty: false15 property bool isDirty: false
1616
1717
=== modified file 'tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py'
--- tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py 2013-08-03 17:15:11 +0000
+++ tests/autopilot/ubuntu_rssreader_app/emulators/main_window.py 2013-08-12 19:46:20 +0000
@@ -30,9 +30,9 @@
30 return self.app.select_single('QQuickListView', objectName = 'topiclist')30 return self.app.select_single('QQuickListView', objectName = 'topiclist')
3131
32 def get_manage_topics_page(self):32 def get_manage_topics_page(self):
33 return self.app.select_single('ManageTopicsPage')33 return self.app.select_single('TopicManagement')
3434
35 def get_canonical_topic(self):35 def get_canonical_topic_labelvisual(self):
36 itemList = self.app.select_many('LabelVisual', text = 'CanonicalTopic')36 itemList = self.app.select_many('LabelVisual', text = 'CanonicalTopic')
37 index = -137 index = -1
38 for item in itemList:38 for item in itemList:
@@ -40,8 +40,13 @@
40 if item.text == "CanonicalTopic":40 if item.text == "CanonicalTopic":
41 return itemList[index]41 return itemList[index]
4242
43## def get_canonical_feed_labelvisual(self):43 def get_canonical_topic_TopicComponent(self):
44## return self.app.select_single('LabelVisual', text = 'Canonical')44 itemList = self.app.select_many("TopicComponent", topicName= "CanonicalTopic")
45 index = -1
46 for item in itemList:
47 index +=1
48 if item.topicName == "CanonicalTopic":
49 return itemList[index]
4550
46 def get_canonical_feed_labelvisual(self):51 def get_canonical_feed_labelvisual(self):
47 itemList = self.app.select_many('LabelVisual', text = 'Canonical')52 itemList = self.app.select_many('LabelVisual', text = 'Canonical')
@@ -60,5 +65,16 @@
60 if item.text == "Canonical":65 if item.text == "Canonical":
61 return itemList[index]66 return itemList[index]
6267
68 def get_canonical_feed_FeedComponent(self):
69 return self.app.select_single("FeedComponent", text = "Canonical")
70
63 def get_header(self):71 def get_header(self):
64 return self.app.select_many("Header")72 return self.app.select_many("Header")
73
74 def get_all_feeds(self):
75 return self.app.select_single('Subtitled', text = 'All articles')
76
77 def get_add_a_topic(self):
78 return self.app.select_single("QQuickItem", objectName = "addTopic")
79
80
6581
=== modified file 'tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py'
--- tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-03 17:15:11 +0000
+++ tests/autopilot/ubuntu_rssreader_app/tests/test_rssreader.py 2013-08-12 19:46:20 +0000
@@ -34,6 +34,106 @@
3434
3535
36 def test_add_remove_feed_and_topic(self):36 def test_add_remove_feed_and_topic(self):
37 """ test add and remove feed and topic"""
38
39 #add topic and feed
40 self._add_feed_and_topic()
41
42 #remove added Canonical topic
43## self._remove_topic()
44
45 #remove added Canonical feed
46 self._remove_feed()
47
48
49 def test_view_feeds(self):
50 """test view feeds"""
51
52 #verify we are on the Shorts page
53 pageName = self.ubuntusdk.get_object("Tab", "Tab0")
54 self.assertThat(pageName.title, Eventually(Equals("Shorts")))
55
56 #-----> view all news:
57 #toggle toolbar
58 self.ubuntusdk.toggle_toolbar()
59 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
60
61 #click on add reads toolbar button
62 self.ubuntusdk.click_toolbar_button('List view')
63
64 #verify we are on the Feeds page
65 feedlistpage = self.ubuntusdk.get_object("FeedListPage", "feedlistpage")
66## #self.assertThat(feedlistpage.title, Eventually(Equals("Feeds")))
67 self.assertThat(feedlistpage.title, Eventually(Equals(" ")))
68
69 #select All articles
70 allFeeds = self.main_window.get_all_feeds()
71 self.assertThat(allFeeds, NotEquals("None"))
72 self.pointing_device.click_object(allFeeds )
73
74 #verify we are on the All articles page
75 articlelistpage = self.ubuntusdk.get_object("ArticleListPage", "articlelistpage")
76 self.assertThat(articlelistpage.title, Eventually(Equals("All articles")))
77
78 #toggle toolbar
79 self.ubuntusdk.toggle_toolbar()
80 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
81
82 #click on back toolbar button
83 self.ubuntusdk.click_toolbar_button('Back')
84
85 #verify we are on the Feeds page
86 feedlistpage = self.ubuntusdk.get_object("FeedListPage", "feedlistpage")
87 self.assertThat(feedlistpage.title, Eventually(Equals("Feeds")))
88
89 #-----> view individual feed:
90 #add topic and feed
91 self._add_feed_and_topic()
92
93 #select Canonical feed
94 canonicalFeed = self.main_window.get_canonical_feed_labelvisual()
95 self.assertThat(canonicalFeed, NotEquals(None))
96 self.pointing_device.click_object(canonicalFeed)
97
98 #verify we are on the Canonical page
99 header = self.main_window.get_header()[0]
100 self.assertThat(header.title, Eventually(Equals("Canonical")))
101
102 #toggle toolbar
103 self.ubuntusdk.toggle_toolbar()
104 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
105
106 #click on back toolbar button
107 self.ubuntusdk.click_toolbar_button('Back')
108
109 #verify we are on the Feeds page
110 feedlistpage = self.ubuntusdk.get_object("FeedListPage", "feedlistpage")
111 self.assertThat(feedlistpage.title, Eventually(Equals("Feeds")))
112
113 #toggle toolbar
114 self.ubuntusdk.toggle_toolbar()
115 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
116
117 #click on back toolbar button
118 self.ubuntusdk.click_toolbar_button('Shorts')
119
120 #verify we are on the Shorts page
121 pageName = self.ubuntusdk.get_object("Tab", "Tab0")
122 self.assertThat(pageName.title, Eventually(Equals("Shorts")))
123
124 #remove added Canonical topic
125 self._remove_topic()
126
127 #remove added Canonical feed
128 self._remove_feed()
129
130 def _add_feed_and_topic(self):
131 """test add feed and topic"""
132
133 #verify we are on the Shorts page
134 pageName = self.ubuntusdk.get_object("Tab", "Tab0")
135 self.assertThat(pageName.title, Eventually(Equals("Shorts")))
136
37 #toggle toolbar137 #toggle toolbar
38 self.ubuntusdk.toggle_toolbar()138 self.ubuntusdk.toggle_toolbar()
39139
@@ -45,8 +145,8 @@
45 self._run_action(addReadsPopover, '+ Add feeds')145 self._run_action(addReadsPopover, '+ Add feeds')
46146
47 #verify Append Feed page is open147 #verify Append Feed page is open
48 header = self.main_window.get_header()[0]148 appendpage = self.ubuntusdk.get_object("AppendFeedPage", "appendfeedpage")
49 self.assertThat(header.title, Eventually(Equals("Append feed")))149 self.assertThat(appendpage.title, Eventually(Equals("Append feed")))
50150
51 #type feed in input field151 #type feed in input field
52 new_Feed_Url = self.main_window.get_append_feed_input_box()152 new_Feed_Url = self.main_window.get_append_feed_input_box()
@@ -55,8 +155,9 @@
55 self.keyboard.type("http://www.canonical.com/rss.xml")155 self.keyboard.type("http://www.canonical.com/rss.xml")
56 self.keyboard.type("\n")156 self.keyboard.type("\n")
57 self.assertThat(new_Feed_Url.text, Eventually(Equals("http://www.canonical.com/rss.xml")))157 self.assertThat(new_Feed_Url.text, Eventually(Equals("http://www.canonical.com/rss.xml")))
58 #---> TODO fix this158 #just for timing issue
59 sleep(1)159 self.assertThat(appendpage.title, Eventually(Equals("Append feed")))
160 self.assertThat(self._canonical_feed, Eventually(Equals("http://www.canonical.com/rss.xml")))
60161
61 #check that feed is updated, not empty162 #check that feed is updated, not empty
62 canonicalFeed = self.main_window.get_canonical_feed_labelvisual()163 canonicalFeed = self.main_window.get_canonical_feed_labelvisual()
@@ -72,8 +173,9 @@
72 nextButton = self.ubuntusdk.get_object("Button", "nextButton")173 nextButton = self.ubuntusdk.get_object("Button", "nextButton")
73 lambda: self.assertThat(nextButton, Eventually(NotEquals(None)))174 lambda: self.assertThat(nextButton, Eventually(NotEquals(None)))
74 self.pointing_device.click_object(nextButton)175 self.pointing_device.click_object(nextButton)
75 header = self.main_window.get_header()[0]176
76 self.assertThat(header.title, Eventually(Equals("Choose topic")))177 chossetopicpage = self.ubuntusdk.get_object("ChooseTopicPage", "choosetopicpage")
178 self.assertThat(chossetopicpage.title, Eventually(Equals("Choose topic")))
77179
78 #add a new topic180 #add a new topic
79 new_Topic_Url = self.main_window.get_new_topic_input_box()181 new_Topic_Url = self.main_window.get_new_topic_input_box()
@@ -83,71 +185,124 @@
83 self.keyboard.type("\n")185 self.keyboard.type("\n")
84186
85 #select canonical topic187 #select canonical topic
86 canonicalTopic = self.main_window.get_canonical_topic()188 canonicalTopic = self.main_window.get_canonical_topic_labelvisual()
87 self.assertThat(canonicalTopic, NotEquals(None))189 self.assertThat(canonicalTopic, NotEquals(None))
88 self.pointing_device.click_object(canonicalTopic)190 self.pointing_device.click_object(canonicalTopic)
89191 #just for timing purposes
90 #remove added Canonical topic192 self.assertThat(canonicalTopic.text, Eventually(Equals("CanonicalTopic")))
91 self._remove_topic()193
92194 #verify we are on the Shorts page
93 #check that it's gone195 pageName = self.ubuntusdk.get_object("Tab", "Tab0")
94 canonicalTopic = self.main_window.get_canonical_topic()196 self.assertThat(pageName.title, Eventually(Equals("Shorts")))
95 #---> TODO fix this
96 sleep(1)
97 self.assertThat(canonicalTopic.text, NotEquals("CanonicalTopic"))
98
99 #remove added Canonical feed
100 self._remove_feed()
101197
102 def _remove_feed(self):198 def _remove_feed(self):
199 #verify we are on the Shorts page
200 pageName = self.ubuntusdk.get_object("Tab", "Tab0")
201 self.assertThat(pageName.title, Eventually(Equals("Shorts")))
202
103 #toggle toolbar203 #toggle toolbar
104 self.ubuntusdk.toggle_toolbar()204 self.ubuntusdk.toggle_toolbar()
105 #click on back toolbar button205 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
106 header = self.main_window.get_header()[0]206
107 self.assertThat(header.title, Eventually(Equals("Topics")))207 #click on back toolbar Button
108 self.ubuntusdk.click_toolbar_button('Back')208 self.ubuntusdk.click_toolbar_button('Edit topics')
109209
110 header = self.main_window.get_header()[0]210 #verify we are on the Management page
111 self.assertThat(header.title, Eventually(Equals("Feeds")))211 feedlistpage = self.ubuntusdk.get_object("TopicManagement", "topicmanagement")
212 self.assertThat(feedlistpage.title, Eventually(Equals("Management")))
213 self.assertThat(feedlistpage.visible, Eventually(Equals(True)))
214
215 #select canonical topic
216 canonicalTopic = self.main_window.get_canonical_topic_TopicComponent()
217 self.assertThat(canonicalTopic, NotEquals(None))
218 self.pointing_device.click_object(canonicalTopic)
219 if canonicalTopic.isExpended == False :
220 self.pointing_device.click_object(canonicalTopic)
221 self.assertThat(canonicalTopic.isExpended, Eventually(Equals(True)))
112222
113 #select canonical feed223 #select canonical feed
114 canonicalFeed = self.main_window.get_canonical_feed()224 canonicalFeed = self.main_window.get_canonical_feed_FeedComponent()
115 self.assertThat(canonicalFeed, NotEquals(None))225 self.assertThat(canonicalFeed, NotEquals(None))
116 self.pointing_device.click_object(canonicalFeed, press_duration=2)226
117227 self.pointing_device.click_object(canonicalFeed)
118 #click on Remove popover action228
119 removeFeedPopover = self.main_window.get_action_popover()229 #verify we are on the Edit Feed page
120 self._run_action(removeFeedPopover, 'Remove')230 editFeedPage = self.ubuntusdk.get_object("EditFeed", "editfeedpage")
231 self.assertThat(editFeedPage.title, Eventually(Equals("Edit Feed")))
232
233 #toggle toolbar
234 self.ubuntusdk.toggle_toolbar()
235 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
236
237 #press delete button
238 deleteButton = self.ubuntusdk.get_object("Button", "deleteButton")
239 self.assertThat(deleteButton, NotEquals(None))
240 self.pointing_device.click_object(deleteButton)
241
242 #verify we are on the Management page
243 feedlistpage = self.ubuntusdk.get_object("TopicManagement", "topicmanagement")
244 self.assertThat(feedlistpage.title, Eventually(Equals("Management")))
245
246 #select canonical topic
247 canonicalTopic = self.main_window.get_canonical_topic_labelvisual()
248 self.assertThat(canonicalTopic, NotEquals(None))
249
250 #check feed has been removed
251 canonicalFeed = self.main_window.get_canonical_feed_FeedComponent()
252 self.assertThat(canonicalFeed, Equals(None))
121253
122 def _remove_topic(self):254 def _remove_topic(self):
255 #verify we are on the Shorts page
256 pageName = self.ubuntusdk.get_object("Tab", "Tab0")
257 self.assertThat(pageName.title, Eventually(Equals("Shorts")))
258
123 #toggle toolbar259 #toggle toolbar
124 self.ubuntusdk.toggle_toolbar()260 self.ubuntusdk.toggle_toolbar()
261 self.assertThat(self.ubuntusdk.get_toolbar().opened, Eventually(Equals(True)))
125262
126 #click on edit topics toolbar button263 #click on edit topics toolbar button
127 self.ubuntusdk.click_toolbar_button('Edit topics')264 self.ubuntusdk.click_toolbar_button('Edit topics')
128 header = self.main_window.get_header()[0]265
129 self.assertThat(header.title, Eventually(Equals("Feeds")))266 #verify we are on the Topics page
130267 topicmanagement = self.ubuntusdk.get_object("TopicManagement", "topicmanagement")
131 self.ubuntusdk.click_toolbar_button('Topics')268 self.assertThat(topicmanagement.title, Eventually(Equals("Management")))
132 header = self.main_window.get_header()[0]269
133 self.assertThat(header.title, Eventually(Equals("Topics")))270 #select canonical topic
134271 canonicalTopic = self.main_window.get_canonical_topic()
135 #select and swipe canonical topic272 #self.assertThat(canonicalTopic, NotEquals(None))
136 canonicalTopic = self.main_window.get_canonical_topic()273 self.assertThat(canonicalTopic.text, Equals("CanonicalTopic"))
137 self.assertThat(canonicalTopic, NotEquals(None))274 self.pointing_device.click_object(canonicalTopic)
138275
139 qmlView = self.ubuntusdk.get_qml_view()276 #verify Canonical feed is visible
140 topicsPage = self.main_window.get_manage_topics_page()277
141278
142 #we have to consider the top tab offset, then create a swipe operation across the width of the page279
143 startX = int(topicsPage.x + topicsPage.width * 0.20)280## qmlView = self.ubuntusdk.get_qml_view()
144 stopX = int(topicsPage.x + topicsPage.width * 0.80)281## self.assertThat(qmlView, NotEquals(None))
145 tabHeightOffset = qmlView.height - topicsPage.height282##
146 lineY = int(qmlView.y + canonicalTopic.y + tabHeightOffset)283## topicsPage = self.main_window.get_manage_topics_page()
147284## self.assertThat(topicsPage, NotEquals(None))
148 #swipe to remove the topic285##
149 self.pointing_device.move(startX, lineY)286## addATopicItem = self.main_window.get_add_a_topic()
150 self.pointing_device.drag(startX, lineY, stopX, lineY)287## self.assertThat(addATopic, NotEquals(None))
288##
289## #we have to consider the top tab offset, then create a swipe operation across the width of the page
290## startX = int(topicsPage.x + topicsPage.width * 0.20)
291## stopX = int(topicsPage.x + topicsPage.width * 0.80)
292## tabHeightOffset = qmlView.height - topicsPage.height + addATopicItem.height
293## lineY = int(qmlView.y + canonicalTopic.y + tabHeightOffset)
294##
295## #swipe to remove the topic
296## self.pointing_device.move(startX, lineY)
297## self.pointing_device.drag(startX, lineY, stopX, lineY)
298
299
300
301
302 #check that it's gone
303 canonicalTopic = None
304 canonicalTopic = self.main_window.get_canonical_topic()
305 self.assertThat(canonicalTopic.visible, Equals(False))
151306
152 def _run_action(self, popover, name):307 def _run_action(self, popover, name):
153 actions = popover.select_many('Empty')308 actions = popover.select_many('Empty')
@@ -157,3 +312,9 @@
157 requested = action312 requested = action
158 self.pointing_device.click_object(requested)313 self.pointing_device.click_object(requested)
159314
315 def _canonical_feed(self):
316 try:
317 return self.main_window.get_append_feed_input_box().text
318 except StateNotFoundError:
319 return None
320

Subscribers

People subscribed via source and target branches