← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/ubuntu-weather-app/fix-ap-tests-001 into lp:ubuntu-weather-app/reboot

 

Andrew Hayzen has proposed merging lp:~ahayzen/ubuntu-weather-app/fix-ap-tests-001 into lp:ubuntu-weather-app/reboot.

Commit message:
* Fix for autopilot tests not using custom back button
* Fix for possible flaky test due to expandHeight changing dynamically
* Fix for null errors as header is undefined

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-weather-app/fix-ap-tests-001/+merge/275335

* Fix for autopilot tests not using custom back button
* Fix for possible flaky test due to expandHeight changing dynamically
* Fix for null errors as header is undefined
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~ahayzen/ubuntu-weather-app/fix-ap-tests-001 into lp:ubuntu-weather-app/reboot.
=== modified file 'app/ui/LocationsPage.qml'
--- app/ui/LocationsPage.qml	2015-10-18 15:50:03 +0000
+++ app/ui/LocationsPage.qml	2015-10-22 13:04:40 +0000
@@ -66,7 +66,7 @@
         anchors {
             fill: parent
             // TODO: Fix this offset
-            topMargin: -locationsPage.header.height
+            topMargin: locationsPage.header ? -locationsPage.header.height : 0
         }
         model: ListModel {
             id: locationsModel

=== modified file 'debian/changelog'
--- debian/changelog	2015-10-21 02:16:50 +0000
+++ debian/changelog	2015-10-22 13:04:40 +0000
@@ -58,6 +58,7 @@
   * Add support for OWM API keys (LP: #1505848)
   * Add autopilot test for expanding the today info
   * Implement extra info expandable for today info (LP: #1496422, LP: #1478255)
+  * Fix for autopilot tests not using custom back button and for possible flaky test due to expandHeight changing dynamically
 
   [ Carla Sella ]
   * Create autopilot test which shows the day delegate (LP: #1452491)

=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot	2015-10-15 10:39:42 +0000
+++ po/com.ubuntu.weather.pot	2015-10-22 13:04:40 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: ubuntu-weather-app\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-10-15 11:39+0100\n"
+"POT-Creation-Date: 2015-10-22 13:33+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -130,7 +130,7 @@
 msgid "Locations"
 msgstr ""
 
-#: ../app/ui/LocationsPage.qml:106
+#: ../app/ui/LocationsPage.qml:109
 msgid "Current Location"
 msgstr ""
 

=== 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-22 13:04:40 +0000
@@ -237,6 +237,9 @@
     def click_add_location_action(self):
         self.main_view.get_header().click_action_button("addLocation")
 
+    def click_back(self):
+        return self.main_view.get_header().click_custom_back_button()
+
     @click_object
     def click_location(self, index):
         return self.get_location(index)

=== 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-22 13:04:40 +0000
@@ -51,7 +51,9 @@
         day_delegate = location_pane.get_day_delegate(day)
 
         # Wait for the height of the delegate to grow
-        day_delegate.height.wait_for(day_delegate.expandedHeight)
+        # Re-get the delegate in the wait as the expandedHeight changes
+        day_delegate.height.wait_for(
+            location_pane.get_day_delegate(day).expandedHeight)
 
         # Check that the state and height of the delegate have changed
         self.assertThat(day_delegate.state, Eventually(Equals("expanded")))
@@ -74,7 +76,9 @@
         home_temp_info = location_pane.get_home_temp_info()
 
         # Wait for the height of the HomeTempInfo to grow
-        home_temp_info.height.wait_for(home_temp_info.expandedHeight)
+        # Re-get the home temp info in the wait as the expandedHeight changes
+        home_temp_info.height.wait_for(
+            location_pane.get_home_temp_info().expandedHeight)
 
         # Check that the state and height of the HomeTempInfo have changed
         self.assertThat(home_temp_info.state, Eventually(Equals("expanded")))