Merge lp:~rpadovani/ubuntu-weather-app/1201705 into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Riccardo Padovani on 2013-07-16
Status: Merged
Approved by: Martin Borho on 2013-07-16
Approved revision: 65
Merged at revision: 65
Proposed branch: lp:~rpadovani/ubuntu-weather-app/1201705
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 39 lines (+18/-0)
2 files modified
components/AddLocationPage.qml (+1/-0)
tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py (+17/-0)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-weather-app/1201705
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2013-07-16
Martin Borho 2013-07-16 Approve on 2013-07-16
Review via email: mp+174947@code.launchpad.net

Commit message

Added test to check if, when no result is found in search list, label error is shown

Description of the change

Added test to check if, when no result is found in search list, label error is shown

To post a comment you must log in.
Martin Borho (martin-borho) wrote :

Fine and fast. Never heard of that city, too! ;)

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 'components/AddLocationPage.qml'
2--- components/AddLocationPage.qml 2013-07-13 13:34:34 +0000
3+++ components/AddLocationPage.qml 2013-07-16 08:30:37 +0000
4@@ -81,6 +81,7 @@
5 color: "transparent"
6 Label {
7 id: noCityError
8+ objectName: "noCityError"
9 visible: false
10 anchors.centerIn: parent;
11 font.pixelSize: 18
12
13=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py'
14--- tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-07-03 19:41:03 +0000
15+++ tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-07-16 08:30:37 +0000
16@@ -103,6 +103,23 @@
17 locationList = self.main_window.get_object('QQuickListView', 'LocationList')
18 self.assertThat(locationList.visible, Eventually(Equals(True)))
19
20+ def test_no_location_found(self):
21+ """Tests if label with 'No city found' is shown """
22+ self._open_add_location_page()
23+
24+ # insert city name to search for
25+ searchField = self.main_window.get_object("TextField", "SearchField")
26+ self.pointing_device.move_to_object(searchField)
27+ self.pointing_device.click()
28+ self.keyboard.type("UbuntuCity") # Unfortunately, no UbuntuCity in the world
29+ self.assertThat(searchField.text, Eventually(Equals("UbuntuCity")))
30+ self.keyboard.press_and_release('Enter')
31+
32+ # wait for result and look if label is shown
33+ errorLabel = self.main_window.get_object('Label', 'noCityError')
34+ self.assertThat(errorLabel.visible, Eventually(Equals(True), timeout=30))
35+
36+
37 class TestLocationManagerWithLocation(WeatherTestCase, DatabaseMixin):
38 def setUp(self):
39 self.clean_db()

Subscribers

People subscribed via source and target branches