~jonas-drange/ubuntu-system-settings/batteryWifiForHotspot

« back to all changes in this revision

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

  • Committer: jonas-drange
  • Date: 2015-08-17 13:50:16 UTC
  • Revision ID: jonas.drange@canonical.com-20150817135016-9k2pbpoi9bs86481
start on changing battery page

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        return self._go_to_page('entryComponent-bluetooth', 'bluetoothPage')
96
96
 
97
97
    @autopilot.logging.log_action(logger.debug)
 
98
    def go_to_battery_page(self):
 
99
        return self._go_to_page('entryComponent-battery', 'batteryPage')
 
100
 
 
101
    @autopilot.logging.log_action(logger.debug)
98
102
    def go_to_phone_page(self):
99
103
        return self._go_to_page('entryComponent-phone', 'phonePage')
100
104
 
492
496
                disconnected_list.select_many('LabelVisual')]
493
497
 
494
498
 
 
499
class BatteryPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
 
500
 
 
501
    """Autopilot helper for Battery page."""
 
502
 
 
503
    @classmethod
 
504
    def validate_dbus_object(cls, path, state):
 
505
        name = introspection.get_classname_from_path(path)
 
506
        if name == b'ItemPage':
 
507
            if state['objectName'][1] == 'batteryPage':
 
508
                return True
 
509
        return False
 
510
 
 
511
    @property
 
512
    @autopilot.logging.log_action(logger.debug)
 
513
    def _switch(self):
 
514
        return self.wait_select_single(
 
515
            ubuntuuitoolkit.CheckBox,
 
516
            objectName='wifiSwitch')
 
517
 
 
518
    @autopilot.logging.log_action(logger.debug)
 
519
    def enable_call_waiting(self):
 
520
        self._switch.check()
 
521
 
 
522
    @autopilot.logging.log_action(logger.debug)
 
523
    def disable_call_waiting(self):
 
524
        self._switch.uncheck()
 
525
 
 
526
 
495
527
class PageCarrierAndApn(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
496
528
 
497
529
    """Autopilot helper for carrier/apn entry page (singlesim)."""