Merge lp:~vthompson/ubuntu-weather-app/fix-1452486-pull-refresh into lp:ubuntu-weather-app

Proposed by Victor Thompson
Status: Needs review
Proposed branch: lp:~vthompson/ubuntu-weather-app/fix-1452486-pull-refresh
Merge into: lp:ubuntu-weather-app
Diff against target: 83 lines (+41/-0)
4 files modified
app/ui/LocationPane.qml (+1/-0)
debian/changelog (+1/-0)
tests/autopilot/ubuntu_weather_app/__init__.py (+22/-0)
tests/autopilot/ubuntu_weather_app/tests/test_home_page.py (+17/-0)
To merge this branch: bzr merge lp:~vthompson/ubuntu-weather-app/fix-1452486-pull-refresh
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Andrew Hayzen Needs Fixing
Review via email: mp+268027@code.launchpad.net

Commit message

* Create autopilot test which does a pull to refresh action

Description of the change

* Create autopilot test which does a pull to refresh action

To post a comment you must log in.
95. By Victor Thompson

Update commentary

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Some inline comment questions..

review: Needs Information
Revision history for this message
Victor Thompson (vthompson) wrote :

I'll need to update this to release when refreshing is true. It'll need to be done that way to ensure the flag changes from False to True.

96. By Victor Thompson

Patch up test

97. By Victor Thompson

Merge and resolve

98. By Victor Thompson

Update commentary

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

This fails for me, and some inline comments.

Traceback (most recent call last):
  File "/tmp/fix-1452486-pull-refresh/tests/autopilot/ubuntu_weather_app/tests/test_home_page.py", line 61, in test_pull_to_refresh
    self.assertThat(home_page.refreshing(), Eventually(Equals(True)))
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 423, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: After 10.0 seconds test on PullToRefresh.refreshing failed: True != dbus.Boolean(False, variant_level=1)

Ran 1 test in 17.798s
FAILED (failures=1)

review: Needs Fixing
99. By Victor Thompson

Update matcher.

Revision history for this message
Victor Thompson (vthompson) wrote :

I've updated the matcher--hopefully that's what was causing the failure for you. It's working for me.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
100. By Victor Thompson

Move refreshing check

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

Merge of trunk and update test

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

Update pep8

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
103. By Victor Thompson

Merge and resolve conflicts.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
104. By Victor Thompson

Merge and resolve conflicts

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Once [0] lands and you merge with it, the LocationPane will be using the correct autopilot helper which then means you'll be able to use the pullToRefresh helper [1] as LocationPane will have the QQuickFlickable properties.

0 - https://code.launchpad.net/~ahayzen/ubuntu-weather-app/fix-1496422-1478255-today-extra-info/+merge/272790
1 - http://people.canonical.com/~nskaggs/autopilot-sdk-helpers.html#ubuntuuitoolkit.QQuickFlickable.pull_to_refresh

review: Needs Fixing
105. By Victor Thompson

Merge trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
106. By Victor Thompson

Adjust the test to occur within the LocationPane

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

Merge of trunk and resolve conflict

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

Unmerged revisions

107. By Victor Thompson

Merge of trunk and resolve conflict

106. By Victor Thompson

Adjust the test to occur within the LocationPane

105. By Victor Thompson

Merge trunk

104. By Victor Thompson

Merge and resolve conflicts

103. By Victor Thompson

Merge and resolve conflicts.

102. By Victor Thompson

Update pep8

101. By Victor Thompson

Merge of trunk and update test

100. By Victor Thompson

Move refreshing check

99. By Victor Thompson

Update matcher.

98. By Victor Thompson

Update commentary

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/ui/LocationPane.qml'
--- app/ui/LocationPane.qml 2015-10-15 14:15:10 +0000
+++ app/ui/LocationPane.qml 2015-10-18 15:24:09 +0000
@@ -130,6 +130,7 @@
130130
131 PullToRefresh {131 PullToRefresh {
132 id: pullToRefresh132 id: pullToRefresh
133 objectName: "pullToRefresh"
133 refreshing: false134 refreshing: false
134 onRefresh: {135 onRefresh: {
135 locationPages.loaded = false136 locationPages.loaded = false
136137
=== modified file 'debian/changelog'
--- debian/changelog 2015-10-16 00:12:57 +0000
+++ debian/changelog 2015-10-18 15:24:09 +0000
@@ -28,6 +28,7 @@
28 * Make sure the text elides on the LocationsPage and the AddLocationPage. (LP: #1469460)28 * Make sure the text elides on the LocationsPage and the AddLocationPage. (LP: #1469460)
29 * Make the first column of the day delegate extra info wider to accommodate other29 * Make the first column of the day delegate extra info wider to accommodate other
30 languages.30 languages.
31 * Create autopilot test which does a pull to refresh action (LP: #1452486)
3132
32 [ Andrew Hayzen ]33 [ Andrew Hayzen ]
33 * Add mocked locations for autopilot and add a test using the data34 * Add mocked locations for autopilot and add a test using the data
3435
=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
--- tests/autopilot/ubuntu_weather_app/__init__.py 2015-10-15 14:12:37 +0000
+++ tests/autopilot/ubuntu_weather_app/__init__.py 2015-10-18 15:24:09 +0000
@@ -228,6 +228,28 @@
228 return self.select_single(228 return self.select_single(
229 "AbstractButton", objectName="settingsButton")229 "AbstractButton", objectName="settingsButton")
230230
231 def pull_to_refresh_data(self):
232 x, y, width, height = self.globalRect
233 start_x = stop_x = x + (width // 2)
234 start_y = y + (height * 0.2)
235 stop_y = y + (height * 0.8)
236
237 # Swipe down (pull), hold, and release
238 self.pointing_device.move(start_x, start_y)
239 self.pointing_device.press()
240 self.pointing_device.move(stop_x, stop_y)
241 self.release_to_refresh().wait_for(True)
242 self.pointing_device.release()
243 self.refreshing().wait_for(True)
244
245 def refreshing(self):
246 return self.wait_select_single(
247 "PullToRefresh", objectName="pullToRefresh").refreshing
248
249 def release_to_refresh(self):
250 return self.wait_select_single(
251 "PullToRefresh", objectName="pullToRefresh").releaseToRefresh
252
231253
232class LocationsPage(Page):254class LocationsPage(Page):
233 """Autopilot helper for LocationsPage."""255 """Autopilot helper for LocationsPage."""
234256
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_home_page.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_home_page.py 2015-09-29 15:21:55 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_home_page.py 2015-10-18 15:24:09 +0000
@@ -57,6 +57,23 @@
57 self.assertThat(day_delegate.state, Eventually(Equals("expanded")))57 self.assertThat(day_delegate.state, Eventually(Equals("expanded")))
58 self.assertEqual(day_delegate.height, day_delegate.expandedHeight)58 self.assertEqual(day_delegate.height, day_delegate.expandedHeight)
5959
60 def test_pull_to_refresh(self):
61 """ tests swiping downward to refresh the app's data """
62
63 location_pane = self.home_page.get_selected_location_pane()
64
65 # Ensure we are not refreshing
66 self.assertThat(location_pane.refreshing(), Equals(False))
67
68 # Swipe down to refresh
69 location_pane.pull_to_refresh_data()
70
71 # Re-get home page as change in loaders changes tree
72 location_pane = self.home_page.get_selected_location_pane()
73
74 # Ensure that eventually we are not refreshing
75 self.assertThat(location_pane.refreshing, Eventually(Equals(False)))
76
60 def test_show_today_details(self):77 def test_show_today_details(self):
61 """tests clicking on the today info to expand and contract it"""78 """tests clicking on the today info to expand and contract it"""
6279

Subscribers

People subscribed via source and target branches

to all changes: