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

Proposed by Vamshi Balanaga on 2016-01-18
Status: Merged
Approved by: Andrew Hayzen on 2016-03-08
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 on 2016-03-08
Andrew Hayzen 2016-01-18 Approve on 2016-03-08
Nicholas Skaggs (community) 2016-01-20 Needs Fixing on 2016-02-02
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.
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
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
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
Vamshi Balanaga (fazerlicourice) wrote :

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

Nicholas Skaggs (nskaggs) wrote :

Top --approving to land. Whew jenkins.

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)
Nicholas Skaggs (nskaggs) wrote :

Text conflict in debian/changelog
1 conflicts encountered.

review: Needs Fixing
206. By Vamshi Balanaga <email address hidden> on 2016-02-06

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

fixed conflict

Vamshi Balanaga (fazerlicourice) wrote :

How do I restart the Jenkins build?

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).

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

review: Needs Fixing (continuous-integration)
review: Needs Fixing (continuous-integration)
review: Needs Fixing (continuous-integration)
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> on 2016-02-20

merged from upstream

review: Needs Fixing (continuous-integration)
review: Needs Fixing (continuous-integration)
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
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2015-08-09 15:32:22 +0000
3+++ AUTHORS 2016-02-20 12:23:17 +0000
4@@ -3,8 +3,9 @@
5 In addition, numerous translations, bug reports and other non-code contributions have been made which are equally valued.
6
7 Andrew Hayzen <ahayzen@gmail.com>
8+Carla Sella <carla.sella@gmail.com>
9 Daniel Holbach <daniel.holbach@canonical.com>
10 Martin Borho <martin@borho.net>
11 Nekhelesh Ramananthan <krnekhelesh@gmail.com>
12+Vamshi Balanaga <vamrocks602@gmail.com>
13 Victor Thompson <victor.thompson@gmail.com>
14-Carla Sella <carla.sella@gmail.com>
15
16=== modified file 'app/components/HeaderRow.qml'
17--- app/components/HeaderRow.qml 2015-11-02 21:28:34 +0000
18+++ app/components/HeaderRow.qml 2016-02-20 12:23:17 +0000
19@@ -28,6 +28,7 @@
20 width: parent.width
21
22 Label {
23+ objectName: 'headerLabel'
24 id: locationNameLabel
25 color: UbuntuColors.darkGrey
26 elide: Text.ElideRight
27
28=== modified file 'debian/changelog'
29--- debian/changelog 2016-01-29 23:07:11 +0000
30+++ debian/changelog 2016-02-20 12:23:17 +0000
31@@ -10,6 +10,9 @@
32 [ Victor Thompson ]
33 * Change translatable string from "rain" to "precipitation" (LP:1521701)
34
35+ [ Vamshi Balanaga ]
36+ * Added test to swipe between location tabs on home page (LP: #1452492)
37+
38 -- Andrew Hayzen <ahayzen@gmail.com> Thu, 03 Dec 2015 15:20:49 +0000
39
40 ubuntu-weather-app (3.1ubuntu1) vivid; urgency=medium
41
42=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
43--- tests/autopilot/ubuntu_weather_app/__init__.py 2015-11-03 00:38:48 +0000
44+++ tests/autopilot/ubuntu_weather_app/__init__.py 2016-02-20 12:23:17 +0000
45@@ -27,7 +27,6 @@
46
47 return func_wrapper
48
49-
50 #
51 # Base helpers
52 #
53@@ -201,6 +200,19 @@
54 def get_selected_location_pane(self):
55 return self.get_location_pane(self.get_selected_location_index())
56
57+ def swipe_left(self):
58+
59+ # Define the start and stop locations of the left swipe
60+ start_x = (self.globalRect.x +
61+ (self.globalRect.width * 0.9))
62+ stop_x = (self.globalRect.x +
63+ (self.globalRect.width * 0.1))
64+ start_y = stop_y = (self.globalRect.y +
65+ (self.globalRect.height * 0.5))
66+ rate = 5
67+
68+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
69+
70
71 class HomeTempInfo(UbuntuUIToolkitCustomProxyObjectBase):
72 pass
73@@ -221,6 +233,10 @@
74
75 return self.get_settings_button()
76
77+ def get_name(self):
78+ return self.wait_select_single(
79+ "UCLabel", objectName='headerLabel').text
80+
81 def get_day_delegate(self, day):
82 return self.wait_select_single(
83 "DayDelegate", objectName="dayDelegate" + str(day))
84
85=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_home_page.py'
86--- tests/autopilot/ubuntu_weather_app/tests/test_home_page.py 2015-10-22 12:49:35 +0000
87+++ tests/autopilot/ubuntu_weather_app/tests/test_home_page.py 2016-02-20 12:23:17 +0000
88@@ -83,3 +83,19 @@
89 # Check that the state and height of the HomeTempInfo have changed
90 self.assertThat(home_temp_info.state, Eventually(Equals("expanded")))
91 self.assertEqual(home_temp_info.height, home_temp_info.expandedHeight)
92+
93+ def test_swiping_locations(self):
94+ """tests swiping between the location tabs"""
95+
96+ # Check that starts at the first (index = 0) location tab
97+ self.assertThat(self.home_page.get_selected_location_index(),
98+ Equals(0))
99+
100+ # Swipe to the left to switch Location tabs
101+ self.home_page.swipe_left()
102+
103+ # Check that the selected location is now the intended location
104+ self.assertThat(self.home_page.get_selected_location_index(),
105+ Eventually(Equals(1)))
106+ self.assertThat(self.home_page.get_location_pane(1).get_name(),
107+ Equals('Washington'))

Subscribers

People subscribed via source and target branches

to all changes: