~canonical-platform-qa/ubuntu-system-tests/qemu-build-snap

« back to all changes in this revision

Viewing changes to ubuntu_system_tests/helpers/ubuntuuitools/cpo/popups.py

  • Committer: Omer Akram
  • Date: 2016-12-05 16:36:34 UTC
  • mfrom: (487.4.1 old-trunk)
  • Revision ID: om26er@ubuntu.com-20161205163634-ixv4q21jfwx8ggi5
Substantially fix trunk history

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from autopilot.introspection import dbus
21
21
from autopilot import introspection
22
22
 
23
 
from ubuntu_system_tests.helpers.ubuntuuitools._cpo import _common
 
23
from ubuntu_system_tests.helpers.ubuntuuitools.cpo import common
24
24
 
25
25
 
26
26
logger = logging.getLogger(__name__)
27
27
 
28
28
 
29
 
class Dialog(_common.CustomProxyObjectBase):
 
29
class Dialog(common.CustomProxyObjectBase):
30
30
    """Autopilot helper for the Dialog component."""
31
31
 
32
32
 
33
 
class TextInputPopover(_common.CustomProxyObjectBase):
 
33
class TextInputPopover(common.CustomProxyObjectBase):
34
34
    """TextInputPopover Autopilot emulator ."""
35
35
 
36
36
    def click_option_by_text(self, text):
46
46
 
47
47
        """
48
48
        if not self.visible:
49
 
            raise _common.UiToolsException('The popover is not open.')
 
49
            raise common.UiToolsException('The popover is not open.')
50
50
        button = self._get_button(text)
51
51
        if button is None:
52
 
            raise _common.UiToolsException(
 
52
            raise common.UiToolsException(
53
53
                'Button with text "{0}" not found.'.format(text))
54
54
        self.pointing_device.click_object(button)
55
55
        if self.autoClose:
68
68
            return self.wait_select_single('AbstractButton', text=text)
69
69
 
70
70
 
71
 
class ActionSelectionPopover(_common.CustomProxyObjectBase):
 
71
class ActionSelectionPopover(common.CustomProxyObjectBase):
72
72
    """ActionSelectionPopover Autopilot custom proxy object."""
73
73
 
74
74
    @classmethod
97
97
            object_name = action_object_name + "_button"
98
98
            button = self.select_single(objectName=object_name)
99
99
        except dbus.StateNotFoundError:
100
 
            raise _common.UiToolsException(
 
100
            raise common.UiToolsException(
101
101
                'Button for action with objectName "{0}" not found.'.format(
102
102
                    action_object_name))
103
103
        ActionSelectionPopover._assert_visible(
121
121
 
122
122
        """
123
123
        if not self.visible:
124
 
            raise _common.UiToolsException('The popover is not open.')
 
124
            raise common.UiToolsException('The popover is not open.')
125
125
        button = self._get_button(text)
126
126
        if button is None:
127
 
            raise _common.UiToolsException(
 
127
            raise common.UiToolsException(
128
128
                'Button with text "{0}" not found.'.format(text))
129
129
        self.pointing_device.click_object(button)
130
130
        if self.autoClose:
143
143
    @staticmethod
144
144
    def _assert_visible(obj, msj):
145
145
        if not obj.visible:
146
 
            raise _common.UiToolsException(msj)
147
 
 
148
 
 
149
 
class ComposerSheet(_common.CustomProxyObjectBase):
 
146
            raise common.UiToolsException(msj)
 
147
 
 
148
 
 
149
class ComposerSheet(common.CustomProxyObjectBase):
150
150
    """ComposerSheet Autopilot custom proxy object."""
151
151
 
152
152
    @autopilot_logging.log_action(logger.info)