~mterry/+junk/wizard

« back to all changes in this revision

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

  • Committer: Michael Terry
  • Date: 2014-06-11 13:42:15 UTC
  • mfrom: (662.1.68 ubuntu-system-settings)
  • Revision ID: michael.terry@canonical.com-20140611134215-6277k4d152d2h8or
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        super(SystemSettingsTestCases, self).setUp()
25
25
 
26
26
    def test_title(self):
27
 
        """ Checks whether the main_view title is correct """
28
 
        header = self.main_view.select_single(objectName='systemSettingsPage')
 
27
        """ Checks whether the app title is correct """
 
28
        header = self.system_settings.main_view.select_single(
 
29
            objectName='systemSettingsPage'
 
30
        )
29
31
        self.assertThat(header, NotEquals(None))
30
32
        self.assertThat(header.title, Eventually(Equals(_('System Settings'))))
31
33
 
32
34
    def test_search(self):
33
35
        """ Checks whether the Search box is available """
34
 
        search = self.main_view.select_single(objectName='searchTextField')
 
36
        search = self.system_settings.main_view.select_single(
 
37
            objectName='searchTextField'
 
38
        )
35
39
        self.assertThat(search, NotEquals(None))
36
40
 
37
41
    def test_network_category(self):
38
42
        """ Checks whether the Network category is available """
39
 
        category = self.main_view.select_single(
 
43
        category = self.system_settings.main_view.select_single(
40
44
            objectName='categoryGrid-network'
41
45
        )
42
46
        self.assertThat(category, NotEquals(None))
46
50
 
47
51
    def test_personal_category(self):
48
52
        """ Checks whether the Personal category is available """
49
 
        category = self.main_view.select_single(
 
53
        category = self.system_settings.main_view.select_single(
50
54
            objectName='categoryGrid-personal'
51
55
        )
52
56
        self.assertThat(category, NotEquals(None))
56
60
 
57
61
    def test_system_category(self):
58
62
        """ Checks whether the System category is available """
59
 
        category = self.main_view.select_single(
 
63
        category = self.system_settings.main_view.select_single(
60
64
            objectName='categoryGrid-system'
61
65
        )
62
66
        self.assertThat(category, NotEquals(None))
64
68
 
65
69
    def test_wifi_plugin(self):
66
70
        """ Checks whether the Wi-Fi plugin is available """
67
 
        plugin = self.main_view.select_single(objectName='entryComponent-wifi')
 
71
        plugin = self.system_settings.main_view.select_single(
 
72
            objectName='entryComponent-wifi'
 
73
        )
68
74
        self.assertThat(plugin, NotEquals(None))
69
75
 
70
76
    def test_cellular_plugin(self):
71
77
        """ Checks whether the Cellunar plugin is available """
72
 
        plugin = self.main_view.select_single(
 
78
        plugin = self.system_settings.main_view.select_single(
73
79
            objectName='entryComponent-cellular'
74
80
        )
75
81
        self.assertThat(plugin, NotEquals(None))
76
82
 
77
83
    def test_bluetooth_plugin(self):
78
84
        """ Checks whether the Bluetooth plugin is available """
79
 
        plugin = self.main_view.select_single(
 
85
        plugin = self.system_settings.main_view.select_single(
80
86
            objectName='entryComponent-bluetooth'
81
87
        )
82
88
        self.assertThat(plugin, NotEquals(None))
83
89
 
84
90
    def test_background_plugin(self):
85
91
        """ Checks whether the Background plugin is available """
86
 
        plugin = self.main_view.select_single(
 
92
        plugin = self.system_settings.main_view.select_single(
87
93
            objectName='entryComponent-background'
88
94
        )
89
95
        self.assertThat(plugin, NotEquals(None))
90
96
 
91
97
    def test_sound_plugin(self):
92
98
        """ Checks whether the Sound plugin is available """
93
 
        plugin = self.main_view.select_single(
 
99
        plugin = self.system_settings.main_view.select_single(
94
100
            objectName='entryComponent-sound'
95
101
        )
96
102
        self.assertThat(plugin, NotEquals(None))
97
103
 
98
104
    def test_language_plugin(self):
99
105
        """ Checks whether the Language plugin is available """
100
 
        plugin = self.main_view.select_single(
 
106
        plugin = self.system_settings.main_view.select_single(
101
107
            objectName='entryComponent-language'
102
108
        )
103
109
        self.assertThat(plugin, NotEquals(None))
104
110
 
105
111
    def test_accounts_plugin(self):
106
112
        """ Checks whether the Accounts plugin is available """
107
 
        plugin = self.main_view.select_single(
 
113
        plugin = self.system_settings.main_view.select_single(
108
114
            objectName='entryComponent-online-accounts'
109
115
        )
110
116
        self.assertThat(plugin, NotEquals(None))
111
117
 
112
118
    def test_timedate_plugin(self):
113
119
        """ Checks whether the Time & Date plugin is available """
114
 
        plugin = self.main_view.select_single(
 
120
        plugin = self.system_settings.main_view.select_single(
115
121
            objectName='entryComponent-time-date'
116
122
        )
117
123
        self.assertThat(plugin, NotEquals(None))
118
124
 
119
125
    def test_security_plugin(self):
120
126
        """ Checks whether the Security plugin is available """
121
 
        plugin = self.main_view.select_single(
 
127
        plugin = self.system_settings.main_view.select_single(
122
128
            objectName='entryComponent-security-privacy'
123
129
        )
124
130
        self.assertThat(plugin, NotEquals(None))
125
131
 
126
132
    def test_updates_plugin(self):
127
133
        """ Checks whether the Updates plugin is available """
128
 
        plugin = self.main_view.select_single(
 
134
        plugin = self.system_settings.main_view.select_single(
129
135
            objectName='entryComponent-system-update'
130
136
        )
131
137
        self.assertThat(plugin, NotEquals(None))
136
142
        super(SystemSettingsUpowerTestCases, self).setUp()
137
143
 
138
144
    def test_no_battery_plugin_without_battery(self):
139
 
        """ Checks whether the Battery plugin is not available as we
140
 
        have no battery.
141
 
        """
142
 
        self.assertThat(lambda: self.main_view.select_single(
 
145
        """ Checks whether the Battery plugin is not available
 
146
        as we have no battery """
 
147
        self.assertThat(lambda: self.system_settings.main_view.select_single(
143
148
            objectName='entryComponent-battery'),
144
149
            raises(StateNotFoundError)
145
150
        )
147
152
    def test_battery_plugin_battery_hotplugging(self):
148
153
        """ Checks whether hotplugging a battery makes the panel visible """
149
154
        self.add_mock_battery()
150
 
        plugin = self.main_view.select_single(
 
155
        plugin = self.system_settings.main_view.select_single(
151
156
            objectName='entryComponent-battery'
152
157
        )
153
158
        self.assertThat(plugin, NotEquals(None))
158
163
        super(SystemSettingsBatteryTestCases, self).setUp()
159
164
 
160
165
    def test_battery_plugin(self):
161
 
        """ checks whether the Battery plugin is available """
162
 
        plugin = self.main_view.select_single(
 
166
        """ Checks whether the Battery plugin is available """
 
167
        plugin = self.system_settings.main_view.select_single(
163
168
            objectName='entryComponent-battery'
164
169
        )
165
170
        self.assertThat(plugin, NotEquals(None))