Merge lp:~ahayzen/ubuntu-weather-app/reboot-1452497-add-location-from-empty-state into lp:ubuntu-weather-app

Proposed by Andrew Hayzen on 2015-07-27
Status: Rejected
Rejected by: Andrew Hayzen on 2015-07-29
Proposed branch: lp:~ahayzen/ubuntu-weather-app/reboot-1452497-add-location-from-empty-state
Merge into: lp:ubuntu-weather-app
Diff against target: 74 lines (+31/-0)
4 files modified
app/ui/AddLocationPage.qml (+1/-0)
debian/changelog (+1/-0)
tests/autopilot/ubuntu_weather_app/__init__.py (+5/-0)
tests/autopilot/ubuntu_weather_app/tests/test_empty_state.py (+24/-0)
To merge this branch: bzr merge lp:~ahayzen/ubuntu-weather-app/reboot-1452497-add-location-from-empty-state
Reviewer Review Type Date Requested Status
Andrew Hayzen Disapprove on 2015-07-29
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-07-27
Review via email: mp+266050@code.launchpad.net

Commit message

* Add autopilot test which adds a location from empty state page via cached location list

Description of the change

* Add autopilot test which adds a location from empty state page via cached location list

This tests that you can add a location from the empty state page via selecting the add button and then using the pre cached location list.

To post a comment you must log in.
Victor Thompson (vthompson) wrote :

I want to hold on merging this until we decide how to do the empty state action, per my comment on your other mp [1].

1 - https://code.launchpad.net/~ahayzen/ubuntu-weather-app/reboot-fix-no-settings-button-empty-state/+merge/266044/comments/667747

Andrew Hayzen (ahayzen) wrote :

Going to abandon this as the tests are moving into their own branch with [2] and they are very similar so I'm going to fold the changes into that branch.

2 - lp:~ahayzen/ubuntu-weather-app/reboot-1452497-add-location-from-home

review: Disapprove

Unmerged revisions

73. By Andrew Hayzen on 2015-07-27

* Alphabetical OCD

72. By Andrew Hayzen on 2015-07-27

* Add autopilot test which adds a location from empty state page via cached location list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ui/AddLocationPage.qml'
2--- app/ui/AddLocationPage.qml 2015-06-28 23:37:10 +0000
3+++ app/ui/AddLocationPage.qml 2015-07-27 23:14:15 +0000
4@@ -206,6 +206,7 @@
5
6 delegate: ListItem {
7 divider.visible: false
8+ objectName: "addLocation" + index
9 Column {
10 anchors {
11 left: parent.left
12
13=== modified file 'debian/changelog'
14--- debian/changelog 2015-07-26 15:24:27 +0000
15+++ debian/changelog 2015-07-27 23:14:15 +0000
16@@ -12,6 +12,7 @@
17 * Add mocked locations for autopilot and add a test using the data
18 * Add setting to disable auto detecting location
19 * When running under autopilot do not auto detect location
20+ * Add autopilot test which adds a location from empty state page via cached location list
21
22 -- Victor Thompson <victor.thompson@gmail.com> Mon, 01 Jun 2015 20:11:23 -0500
23
24
25=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
26--- tests/autopilot/ubuntu_weather_app/__init__.py 2015-07-23 00:36:06 +0000
27+++ tests/autopilot/ubuntu_weather_app/__init__.py 2015-07-27 23:14:15 +0000
28@@ -62,6 +62,11 @@
29 def __init__(self, *args):
30 super(AddLocationPage, self).__init__(*args)
31
32+ @click_object
33+ def click_location(self, index):
34+ return self.select_single("UCListItem",
35+ objectName="addLocation" + str(index))
36+
37
38 class HomePage(Page):
39 """Autopilot helper for HomePage."""
40
41=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_empty_state.py'
42--- tests/autopilot/ubuntu_weather_app/tests/test_empty_state.py 2015-07-18 19:08:21 +0000
43+++ tests/autopilot/ubuntu_weather_app/tests/test_empty_state.py 2015-07-27 23:14:15 +0000
44@@ -24,6 +24,30 @@
45 def setUp(self):
46 super(TestEmptyState, self).setUp()
47
48+ def test_add_location(self):
49+ """ tests adding a location via the button and selecting a cached
50+ location """
51+
52+ # Get the start count of the homepage
53+ home_page = self.app.get_home_page()
54+ start_count = home_page.get_location_count()
55+
56+ # Open the locations page
57+ self.app.click_add_location_button()
58+
59+ add_location_page = self.app.get_add_location_page()
60+ add_location_page.visible.wait_for(True)
61+
62+ # Select the location
63+ add_location_page.click_location(0)
64+
65+ # Check that the location was added
66+ self.assertThat(home_page.get_location_count,
67+ Eventually(Equals(start_count + 1)))
68+
69+ # Check homepage is now visible
70+ self.assertThat(home_page.visible, Eventually(Equals(True)))
71+
72 def test_add_location_button(self):
73 """ tests that the add location page is shown after the Add Location
74 button is clicked """

Subscribers

People subscribed via source and target branches

to all changes: