~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to tests/autopilot/calendar_app/__init__.py

  • Committer: carla-sella
  • Date: 2015-04-14 19:52:04 UTC
  • mto: This revision was merged to the branch mainline in revision 630.
  • Revision ID: carla.sella@gmail.com-20150414195204-vy2uo0r90y5x6u3i
Completed Calendar management tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
297
297
        header = self.get_header()
298
298
        header.click_action_button('todaybutton')
299
299
 
 
300
    @autopilot.logging.log_action(logger.info)
 
301
    def get_ColorPickerDialog(self):
 
302
        return self.wait_select_single(
 
303
            "ColorPickerDialog", objectName="colorPickerDialog")
 
304
 
300
305
 
301
306
class YearView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
302
307
 
1026
1031
    def press_check_box_button(self, calendarName):
1027
1032
        """ press check box button to select or unselect it """
1028
1033
        calendar = self._get_calendar(calendarName)
1029
 
 
1030
1034
        check_box = calendar.wait_select_single(
1031
1035
            "CheckBox", objectName="checkBox")
1032
1036
        self.pointing_device.click_object(check_box)
1044
1048
        calendar = self._get_calendar(calendarName)
1045
1049
        return calendar.wait_select_single(
1046
1050
            "CheckBox", objectName="checkBox").checked
 
1051
 
 
1052
    @autopilot.logging.log_action(logger.debug)
 
1053
    def get_calendar_color(self, calendarName):
 
1054
        """ get calendar color """
 
1055
        calendar = self._get_calendar(calendarName)
 
1056
        return calendar.select_single(
 
1057
            "QQuickRectangle", objectName="calendarColorCode").color
 
1058
 
 
1059
    @autopilot.logging.log_action(logger.debug)
 
1060
    def open_color_picker_dialog(self, calendarName):
 
1061
        """ press color rectangle to open calendar color picker"""
 
1062
        calendar = self._get_calendar(calendarName)
 
1063
        color_rectangle = calendar.wait_select_single(
 
1064
            "QQuickRectangle", objectName="calendarColorCode")
 
1065
        self.pointing_device.click_object(color_rectangle)
 
1066
 
 
1067
 
 
1068
class ColorPickerDialog(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
 
1069
    """Autopilot helper for the Color Picker Dialog."""
 
1070
 
 
1071
    @autopilot.logging.log_action(logger.debug)
 
1072
    def change_calendar_color(self, new_color):
 
1073
        new_color_circle = self.wait_select_single(
 
1074
            "QQuickRectangle", objectName=new_color)
 
1075
        self.pointing_device.click_object(new_color_circle)