← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~vthompson/ubuntu-weather-app/fix-1452499 into lp:ubuntu-weather-app/reboot

 

Victor Thompson has proposed merging lp:~vthompson/ubuntu-weather-app/fix-1452499 into lp:ubuntu-weather-app/reboot.

Commit message:
* Create autopilot test which removes a single location

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)
Related bugs:
  Bug #1452499 in Ubuntu Weather App: "[reboot] Autopilot Testcase Needed: Removing a location"
  https://bugs.launchpad.net/ubuntu-weather-app/+bug/1452499

For more details, see:
https://code.launchpad.net/~vthompson/ubuntu-weather-app/fix-1452499/+merge/267428

* Create autopilot test which removes a single location
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~vthompson/ubuntu-weather-app/fix-1452499 into lp:ubuntu-weather-app/reboot.
=== modified file 'debian/changelog'
--- debian/changelog	2015-08-07 01:22:44 +0000
+++ debian/changelog	2015-08-07 23:51:46 +0000
@@ -11,6 +11,7 @@
   * Fix the CMakeLists.txt to include the app icon
   * Rename EmptyStateComponent to HomePageEmptyStateComponent
   * Add a LocationsPageEmptyStateComponent
+  * Create autopilot test which removes a single location (LP: #1452499)
 
   [ Andrew Hayzen ]
   * Add mocked locations for autopilot and add a test using the data

=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
--- tests/autopilot/ubuntu_weather_app/__init__.py	2015-08-06 00:10:53 +0000
+++ tests/autopilot/ubuntu_weather_app/__init__.py	2015-08-07 23:51:46 +0000
@@ -139,6 +139,17 @@
         return self.select_single(WeatherListItem,
                                   objectName="location" + str(index))
 
+    def remove_single_location(self, index):
+        list_item = self.get_location(0)
+        x, y, width, height = list_item.globalRect
+        start_x = x + (width * 0.2)
+        stop_x = x + (width * 0.8)
+        start_y = stop_y = y + (height // 2)
+
+        self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
+
+        list_item.select_remove()
+
 
 class MainView(MainView):
     """Autopilot custom proxy object for the MainView."""
@@ -152,3 +163,7 @@
 class WeatherListItem(UbuntuUIToolkitCustomProxyObjectBase):
     def get_name(self):
         return self.select_single("Label", objectName="name").text
+
+    @click_object
+    def select_remove(self):
+        return self.select_single(objectName="swipeDeleteAction")


Follow ups