Merge lp:~fazerlicourice/ubuntu-weather-app/autopilot-test-switch-locations into lp:ubuntu-weather-app

Proposed by Vamshi Balanaga
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 207
Merged at revision: 225
Proposed branch: lp:~fazerlicourice/ubuntu-weather-app/autopilot-test-switch-locations
Merge into: lp:ubuntu-weather-app
Diff against target: 107 lines (+39/-2)
5 files modified
AUTHORS (+2/-1)
app/components/HeaderRow.qml (+1/-0)
debian/changelog (+3/-0)
tests/autopilot/ubuntu_weather_app/__init__.py (+17/-1)
tests/autopilot/ubuntu_weather_app/tests/test_home_page.py (+16/-0)
To merge this branch: bzr merge lp:~fazerlicourice/ubuntu-weather-app/autopilot-test-switch-locations
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Andrew Hayzen Approve
Nicholas Skaggs (community) Needs Fixing
Review via email: mp+282988@code.launchpad.net

Commit message

added test to swipe between locations on home_page

Description of the change

Created a test that swipes between the location tabs on the homepage and checks that they change correctly.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Not run autopilot yet, but the code looks good.

A few inline comments, related to moving parts of the code into the helper and getting the right label to test from.

Also remember to add a debian/changelog entry (via $ dch)

review: Needs Fixing
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

A few more diff comments, this is looking nice though. I haven't been able to run this on my desktop due to an old UITK version, I'll try on my device tomorrow.

review: Needs Fixing
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

This passes autopilot on my device \o/

adt-run [14:26:28]: test autopilot: - - - - - - - - - - results - - - - - - - - - -
autopilot PASS

There are a few minor comments I've added.

I will also add the team to review, which should add jenkins (IIRC jenkins is failing at the moment, so when we have fixed that in a separate branch you may have todo a pull).

review: Needs Fixing
Revision history for this message
Vamshi Balanaga (fazerlicourice) wrote :

Is this branch ready to be merged yet? Ie, has Jenkins been fixed?

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

Top --approving to land. Whew jenkins.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/weather-app-autolanding/411/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1564/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Text conflict in debian/changelog
1 conflicts encountered.

review: Needs Fixing
206. By Vamshi Balanaga <email address hidden>

* Use sidestage so that tablets don't go into portrait mode
[ Victor Thompson ]
* Change translatable string from "rain" to "precipitation" (LP:1521701)

fixed conflict

Revision history for this message
Vamshi Balanaga (fazerlicourice) wrote :

How do I restart the Jenkins build?

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

Vamshi, you aren't a member of an of the development teams, so you don't have any powers. Let me fix that :-) I added you to a team. You should be able to click the rebuild link (though jenkins will run on all new commits now).

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

You can also build any branch you wish at any time: https://core-apps-jenkins.ubuntu.com/job/weather-app-ci/build?delay=0sec

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

How is this coming along? Do we feel this test is possible using qmltestrunner instead of autopilot?

207. By Vamshi Balanaga <email address hidden>

merged from upstream

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Running this on a device, the only test that fails is test_add_location_via_search which shouldn't be affected from this code, therefore I am approving this branch!

Sorry it has taken *so* long :-/

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2015-08-09 15:32:22 +0000
+++ AUTHORS 2016-02-20 12:23:17 +0000
@@ -3,8 +3,9 @@
3In addition, numerous translations, bug reports and other non-code contributions have been made which are equally valued.3In addition, numerous translations, bug reports and other non-code contributions have been made which are equally valued.
44
5Andrew Hayzen <ahayzen@gmail.com>5Andrew Hayzen <ahayzen@gmail.com>
6Carla Sella <carla.sella@gmail.com>
6Daniel Holbach <daniel.holbach@canonical.com>7Daniel Holbach <daniel.holbach@canonical.com>
7Martin Borho <martin@borho.net>8Martin Borho <martin@borho.net>
8Nekhelesh Ramananthan <krnekhelesh@gmail.com>9Nekhelesh Ramananthan <krnekhelesh@gmail.com>
10Vamshi Balanaga <vamrocks602@gmail.com>
9Victor Thompson <victor.thompson@gmail.com>11Victor Thompson <victor.thompson@gmail.com>
10Carla Sella <carla.sella@gmail.com>
1112
=== modified file 'app/components/HeaderRow.qml'
--- app/components/HeaderRow.qml 2015-11-02 21:28:34 +0000
+++ app/components/HeaderRow.qml 2016-02-20 12:23:17 +0000
@@ -28,6 +28,7 @@
28 width: parent.width28 width: parent.width
2929
30 Label {30 Label {
31 objectName: 'headerLabel'
31 id: locationNameLabel32 id: locationNameLabel
32 color: UbuntuColors.darkGrey33 color: UbuntuColors.darkGrey
33 elide: Text.ElideRight34 elide: Text.ElideRight
3435
=== modified file 'debian/changelog'
--- debian/changelog 2016-01-29 23:07:11 +0000
+++ debian/changelog 2016-02-20 12:23:17 +0000
@@ -10,6 +10,9 @@
10 [ Victor Thompson ]10 [ Victor Thompson ]
11 * Change translatable string from "rain" to "precipitation" (LP:1521701)11 * Change translatable string from "rain" to "precipitation" (LP:1521701)
1212
13 [ Vamshi Balanaga ]
14 * Added test to swipe between location tabs on home page (LP: #1452492)
15
13 -- Andrew Hayzen <ahayzen@gmail.com> Thu, 03 Dec 2015 15:20:49 +000016 -- Andrew Hayzen <ahayzen@gmail.com> Thu, 03 Dec 2015 15:20:49 +0000
1417
15ubuntu-weather-app (3.1ubuntu1) vivid; urgency=medium18ubuntu-weather-app (3.1ubuntu1) vivid; urgency=medium
1619
=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
--- tests/autopilot/ubuntu_weather_app/__init__.py 2015-11-03 00:38:48 +0000
+++ tests/autopilot/ubuntu_weather_app/__init__.py 2016-02-20 12:23:17 +0000
@@ -27,7 +27,6 @@
2727
28 return func_wrapper28 return func_wrapper
2929
30
31#30#
32# Base helpers31# Base helpers
33#32#
@@ -201,6 +200,19 @@
201 def get_selected_location_pane(self):200 def get_selected_location_pane(self):
202 return self.get_location_pane(self.get_selected_location_index())201 return self.get_location_pane(self.get_selected_location_index())
203202
203 def swipe_left(self):
204
205 # Define the start and stop locations of the left swipe
206 start_x = (self.globalRect.x +
207 (self.globalRect.width * 0.9))
208 stop_x = (self.globalRect.x +
209 (self.globalRect.width * 0.1))
210 start_y = stop_y = (self.globalRect.y +
211 (self.globalRect.height * 0.5))
212 rate = 5
213
214 self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
215
204216
205class HomeTempInfo(UbuntuUIToolkitCustomProxyObjectBase):217class HomeTempInfo(UbuntuUIToolkitCustomProxyObjectBase):
206 pass218 pass
@@ -221,6 +233,10 @@
221233
222 return self.get_settings_button()234 return self.get_settings_button()
223235
236 def get_name(self):
237 return self.wait_select_single(
238 "UCLabel", objectName='headerLabel').text
239
224 def get_day_delegate(self, day):240 def get_day_delegate(self, day):
225 return self.wait_select_single(241 return self.wait_select_single(
226 "DayDelegate", objectName="dayDelegate" + str(day))242 "DayDelegate", objectName="dayDelegate" + str(day))
227243
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_home_page.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_home_page.py 2015-10-22 12:49:35 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_home_page.py 2016-02-20 12:23:17 +0000
@@ -83,3 +83,19 @@
83 # Check that the state and height of the HomeTempInfo have changed83 # Check that the state and height of the HomeTempInfo have changed
84 self.assertThat(home_temp_info.state, Eventually(Equals("expanded")))84 self.assertThat(home_temp_info.state, Eventually(Equals("expanded")))
85 self.assertEqual(home_temp_info.height, home_temp_info.expandedHeight)85 self.assertEqual(home_temp_info.height, home_temp_info.expandedHeight)
86
87 def test_swiping_locations(self):
88 """tests swiping between the location tabs"""
89
90 # Check that starts at the first (index = 0) location tab
91 self.assertThat(self.home_page.get_selected_location_index(),
92 Equals(0))
93
94 # Swipe to the left to switch Location tabs
95 self.home_page.swipe_left()
96
97 # Check that the selected location is now the intended location
98 self.assertThat(self.home_page.get_selected_location_index(),
99 Eventually(Equals(1)))
100 self.assertThat(self.home_page.get_location_pane(1).get_name(),
101 Equals('Washington'))

Subscribers

People subscribed via source and target branches

to all changes: