← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~carla-sella/ubuntu-calendar-app/weekview-test-default-view into lp:ubuntu-calendar-app

 

Carla Sella has proposed merging lp:~carla-sella/ubuntu-calendar-app/weekview-test-default-view into lp:ubuntu-calendar-app.

Commit message:
Autopilot tests for Calendar app

Requested reviews:
  Nicholas Skaggs (nskaggs)
Related bugs:
  Bug #1425267 in Ubuntu Calendar App: "Autopilot test:  Weekview test suite need updated"
  https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1425267

For more details, see:
https://code.launchpad.net/~carla-sella/ubuntu-calendar-app/weekview-test-default-view/+merge/254493

Completing test_default_view in test_weekview.py.
-- 
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.
=== modified file 'tests/autopilot/calendar_app/__init__.py'
--- tests/autopilot/calendar_app/__init__.py	2015-03-07 10:14:46 +0000
+++ tests/autopilot/calendar_app/__init__.py	2015-03-29 13:37:52 +0000
@@ -427,6 +427,17 @@
                 sorteddays.insert(0, day)
         return sorteddays
 
+    @autopilot.logging.log_action(logger.info)
+    def get_headerdatecomponent(self, now):
+        today = datetime.date(now.year, now.month, now.day)
+        header_date_components = self.select_many('HeaderDateComponent')
+        for header in header_date_components:
+            header_date = datetime.date(header.date.datetime.year,
+                                        header.date.datetime.month,
+                                        header.date.datetime.day)
+            if header_date == today:
+                return header
+
 
 class MonthView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
 

=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
--- tests/autopilot/calendar_app/tests/test_weekview.py	2015-02-26 16:29:18 +0000
+++ tests/autopilot/calendar_app/tests/test_weekview.py	2015-03-29 13:37:52 +0000
@@ -61,7 +61,12 @@
         self.assertThat(self.app.main_view.get_month_year(self.week_view),
                         Equals(expected_month_name_year))
 
-        # TODO: check current day is highlighted
+        # check current day is highlighted
+        header_date = self.week_view.get_headerdatecomponent(now)
+        self.assertEquals(header_date.dayColor[0], 221)
+        self.assertEquals(header_date.dayColor[1], 72)
+        self.assertEquals(header_date.dayColor[2], 20)
+        self.assertEquals(header_date.dayColor[3], 255)
 
     # These testing stubs need completed
     # def test_scroll_week_must_scroll_within_week(self):


Follow ups