Andrew Hayzen has proposed merging 
lp:~ahayzen/ubuntu-clock-app/fix-1535488-autopilot-failing into 
lp:ubuntu-clock-app.

Commit message:
* Fixes for various autopilot issues

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)
Related bugs:
  Bug #1535488 in Ubuntu Clock App: "Clock is failing to pass on jenkins,  
test_add_city_by_searching_must_add_world_city"
  https://bugs.launchpad.net/ubuntu-clock-app/+bug/1535488

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-clock-app/fix-1535488-autopilot-failing/+merge/283021

* Fixes for various autopilot issues

This resolves various issues with MainView or AbsractButton->UCAbstractButton 
and a repeater which appears as a listview etc.


Note that I'm not able to run the autopilot test suite on device? I'm on a Wily 
desktop so my UITK isn't fully up to date, therefore the picker does not 
function correctly. This has resulted in 3 tests still failing on my desktop, 
all with "autopilot.exceptions.StateNotFoundError: Object not found with name 
'Picker' and properties {'objectName': 'PickerRow_HoursPicker'}".

Ran 5 tests in 71.862s
FAILED (failures=3)
~/Workspace/Ubuntu/ubuntu-clock-app/tests/autopilot


If someone is able to run the tests correctly, and they are still failing, 
please pastebin the output and I'll fix any further issues. Or my hope is that 
we'll be able to use jenkins :-)
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of 
lp:~ahayzen/ubuntu-clock-app/fix-1535488-autopilot-failing into 
lp:ubuntu-clock-app.
=== modified file 'AUTHORS'
--- AUTHORS	2015-08-04 09:17:36 +0000
+++ AUTHORS	2016-01-19 01:36:03 +0000
@@ -7,6 +7,7 @@
 Albert Astals <albert.ast...@canonical.com>
 Alessandro Pozzi <signor.h...@gmail.com>
 Andrea Cerisara <andreaceris...@gmail.com>
+Andrew Hayzen <ahay...@gmail.com>
 Andrew Starr-Bochicchio <a.star...@gmail.com>
 Anthony Wong <anthony.w...@canonical.com>
 Bartosz Kosiorek <gan...@poczta.onet.pl>

=== modified file 'debian/changelog'
--- debian/changelog	2015-12-16 21:46:11 +0000
+++ debian/changelog	2016-01-19 01:36:03 +0000
@@ -5,6 +5,9 @@
   * Move to use the new SDK components v1.3 (LP: #1508363)
   * Fix continously move the alarm volume slider to the desired value (LP: #1492584)  
 
+  [ Andrew Hayzen ]
+  * Fixes for various autopilot issues (LP: #1535488)
+
  -- Bartosz Kosiorek <gan...@poczta.onet.pl>  Wed, 16 Dec 2015 22:44:49 +0100
 
 ubuntu-clock-app (3.6)  vivid; urgency=medium

=== modified file 'tests/autopilot/ubuntu_clock_app/__init__.py'
--- tests/autopilot/ubuntu_clock_app/__init__.py	2015-09-14 20:53:36 +0000
+++ tests/autopilot/ubuntu_clock_app/__init__.py	2016-01-19 01:36:03 +0000
@@ -40,7 +40,9 @@
     def __init__(self, app_proxy, test_type):
         self.app = app_proxy
         self.test_type = test_type
-        self.main_view = self.app.wait_select_single(MainView)
+        # Use only objectName due to bug 1350532 as it is MainView12
+        self.main_view = self.app.wait_select_single(
+            objectName="clockMainView")
 
     @property
     def pointing_device(self):
@@ -49,11 +51,6 @@
 
 class MainView(ubuntuuitoolkit.MainView):
 
-    # bug 1341671 means AP sees this as MainView12
-    @classmethod
-    def get_type_query_name(cls):
-        return 'MainView12'
-
     @autopilot_logging.log_action(logger.info)
     def open_clock(self):
         """Open the Clock Page.
@@ -70,8 +67,8 @@
         :return: the Alarm Page.
 
         """
-        clockPage = self.open_clock()
-        clockPage.reveal_bottom_edge_page()
+        mainPage = self.get_main_page()
+        mainPage.reveal_bottom_edge_page()
         self.get_header().visible.wait_for(True)
         return self.wait_select_single(AlarmPage)
 
@@ -79,6 +76,9 @@
         """ Get the AlarmList object. """
         return AlarmList.select(self)
 
+    def get_main_page(self):
+        return self.wait_select_single(MainPage, objectName="mainPage")
+
     @autopilot_logging.log_action(logger.info)
     def get_worldCityList(self):
         """ Return the World City List page """
@@ -94,7 +94,10 @@
         super(Page, self).__init__(*args)
         # XXX we need a better way to keep reference to the main view.
         # --elopio - 2014-01-31
-        self.main_view = self.get_root_instance().select_single(MainView)
+
+        # Use only objectName due to bug 1350532 as it is MainView12
+        self.main_view = self.get_root_instance().select_single(
+            objectName="clockMainView")
 
 
 class PageWithBottomEdge(Page):
@@ -126,7 +129,11 @@
             raise
 
 
-class ClockPage(PageWithBottomEdge):
+class MainPage(PageWithBottomEdge):
+    pass
+
+
+class ClockPage(Page):
     """Autopilot helper for the Clock page."""
 
     @autopilot_logging.log_action(logger.info)
@@ -134,7 +141,7 @@
         """Swipe to reveal WorldCityList"""
 
         addWorldCityButton = self.wait_select_single(
-            "AbstractButton", objectName="addWorldCityButton")
+            "UCAbstractButton", objectName="addWorldCityButton")
         self.pointing_device.click_object(addWorldCityButton)
 
     def get_num_of_saved_cities(self):
@@ -144,7 +151,7 @@
     def _get_saved_world_city_list(self):
         """Return the saved world city listview object"""
         return self.wait_select_single(
-            "QQuickRepeater", objectName='userWorldCityRepeater')
+            "QQuickListView", objectName='userWorldCityRepeater')
 
     @autopilot_logging.log_action(logger.info)
     def delete_added_world_city(self, city_Name, country_Name):

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to     : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to