Merge lp:~ken-vandine/ubuntu-system-settings/less_flaky into lp:ubuntu-system-settings
- less_flaky
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 1224 |
Merged at revision: | 1249 |
Proposed branch: | lp:~ken-vandine/ubuntu-system-settings/less_flaky |
Merge into: | lp:ubuntu-system-settings |
Diff against target: |
1516 lines (+321/-300) 13 files modified
tests/autopilot/ubuntu_system_settings/__init__.py (+41/-28) tests/autopilot/ubuntu_system_settings/tests/__init__.py (+54/-66) tests/autopilot/ubuntu_system_settings/tests/test_about.py (+10/-15) tests/autopilot/ubuntu_system_settings/tests/test_background.py (+5/-5) tests/autopilot/ubuntu_system_settings/tests/test_datetime.py (+19/-24) tests/autopilot/ubuntu_system_settings/tests/test_main.py (+4/-4) tests/autopilot/ubuntu_system_settings/tests/test_phone.py (+3/-20) tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py (+32/-0) tests/autopilot/ubuntu_system_settings/tests/test_plugins.py (+18/-18) tests/autopilot/ubuntu_system_settings/tests/test_search.py (+4/-4) tests/autopilot/ubuntu_system_settings/tests/test_security.py (+88/-67) tests/autopilot/ubuntu_system_settings/tests/test_sound.py (+36/-42) tests/autopilot/ubuntu_system_settings/tests/test_wifi.py (+7/-7) |
To merge this branch: | bzr merge lp:~ken-vandine/ubuntu-system-settings/less_flaky |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Leo Arias (community) | code review | Approve | |
Ubuntu Touch System Settings | Pending | ||
Review via email: mp+242957@code.launchpad.net |
Commit message
Tiny step towards improved use of the preferred page-object model, hopefully making some tests more reliable.
Description of the change
Tiny step towards improved use of the preferred page-object model, hopefully making some tests more reliable.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1215
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1216. By Ken VanDine
-
dropped the about_page property
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1216
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1217. By Ken VanDine
-
Dropped properties for pages
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1217
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1217
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Leo Arias (elopio) wrote : | # |
Yes, looks good to me. Thanks Ken.
A couple of suggestions:
252 + self.time_date_page = self.system_
253 + main_view.
We usually avoid the line breaks. You can make the statement shorter by making a main_view attribute in the base system settings test case, like:
self.main_view = self.system_
I added the system settings object because we want to use these helpers in integration tests with other apps. But for the cases inside system settings it will be obvious that we are referring it.
A more clever solution would be to make SystemSettings the custom proxy object for MainView, but that needs some python and autopilot dark magic that it's not yet working as I would like.
Also, you could rename the time_date_page attribute to just page. Again, as you are inside the time and date test case, it would be obvious which page we are talking about.
self.page = self.main_
When it is impossible to make the statement shorter, or it will make things hard to read, we prefer this form:
attribute = (
some_
And, for consistency, we prefer to use single quotes for strings.
These are just suggestions. I'm happy with your change, so +1. Please check that the tests pass or at least that you are not breaking new ones before merging.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1217
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1217
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1217
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1218. By Ken VanDine
-
cleanup based on review comments
- 1219. By Ken VanDine
-
Added property for main_view and use it for convience
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1219
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1219
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1219
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1220. By Ken VanDine
-
tidy up the sound test and use wait_for_bus_object instead of sleep
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1219
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1221. By Ken VanDine
-
Moved PhoneSoundTestCase
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1220
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1221
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1221
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1221
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1222. By Ken VanDine
-
merged trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1222
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1222
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1223. By Ken VanDine
-
skip test_call_
vibrate_ silent_ mode_sound_ switch until we figure out why it fails in CI
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1223
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1224. By Ken VanDine
-
merged trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1223
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1224
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1224
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1225. By Ken VanDine
-
removed test_call_
vibrate_ silent_ mode_sound_ switch, the skip isn't enough. The setup seems to be what's triggering the autopilot3 crash
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1225
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1225
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1225
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1226. By Ken VanDine
-
merged trunk
- 1227. By Ken VanDine
-
merged fixes from elopio
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1227
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1227
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1227
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'tests/autopilot/ubuntu_system_settings/__init__.py' |
2 | --- tests/autopilot/ubuntu_system_settings/__init__.py 2014-11-11 14:54:10 +0000 |
3 | +++ tests/autopilot/ubuntu_system_settings/__init__.py 2015-01-08 21:37:23 +0000 |
4 | @@ -119,6 +119,27 @@ |
5 | def go_to_cellular_page(self): |
6 | return self._go_to_page('entryComponent-cellular', 'cellularPage') |
7 | |
8 | + @autopilot.logging.log_action(logger.debug) |
9 | + def go_to_phone_page(self): |
10 | + return self._go_to_page('entryComponent-phone', 'phonePage') |
11 | + |
12 | + @autopilot.logging.log_action(logger.debug) |
13 | + def go_to_about_page(self): |
14 | + return self._go_to_page('entryComponent-about', 'aboutPage') |
15 | + |
16 | + @autopilot.logging.log_action(logger.debug) |
17 | + def go_to_sound_page(self): |
18 | + return self._go_to_page('entryComponent-sound', 'soundPage') |
19 | + |
20 | + @autopilot.logging.log_action(logger.debug) |
21 | + def go_to_security_page(self): |
22 | + return self._go_to_page('entryComponent-security-privacy', |
23 | + 'securityPrivacyPage') |
24 | + |
25 | + @autopilot.logging.log_action(logger.debug) |
26 | + def go_to_datetime_page(self): |
27 | + return self._go_to_page('entryComponent-time-date', 'timeDatePage') |
28 | + |
29 | def _go_to_page(self, item_object_name, page_object_name): |
30 | self.click_item(item_object_name) |
31 | page = self.wait_select_single(objectName=page_object_name) |
32 | @@ -150,11 +171,6 @@ |
33 | return self.select_single(objectName='systemSettingsPage') |
34 | |
35 | @property |
36 | - def cellular_page(self): |
37 | - """ Return 'Cellular' page """ |
38 | - return self.select_single(objectName='cellularPage') |
39 | - |
40 | - @property |
41 | def choose_page(self): |
42 | """ Return 'Choose carrier' page """ |
43 | return self.select_single(objectName="chooseCarrierPage") |
44 | @@ -175,26 +191,6 @@ |
45 | return self.select_single(objectName='backgroundPage') |
46 | |
47 | @property |
48 | - def sound_page(self): |
49 | - """ Return 'Sound' page """ |
50 | - return self.select_single(objectName='soundPage') |
51 | - |
52 | - @property |
53 | - def security_page(self): |
54 | - """ Return 'Security' page """ |
55 | - return self.select_single(objectName='securityPrivacyPage') |
56 | - |
57 | - @property |
58 | - def about_page(self): |
59 | - """ Return 'About' page """ |
60 | - return self.select_single(objectName='aboutPage') |
61 | - |
62 | - @property |
63 | - def wifi_page(self): |
64 | - """ Return 'Wifi' page """ |
65 | - return self.select_single(objectName='wifiPage') |
66 | - |
67 | - @property |
68 | def _orientation_lock_switch(self): |
69 | return self.wait_select_single( |
70 | ubuntuuitoolkit.CheckBox, |
71 | @@ -209,7 +205,7 @@ |
72 | |
73 | class CellularPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
74 | |
75 | - """Autopilot helper for the Sound page.""" |
76 | + """Autopilot helper for the Cellular page.""" |
77 | |
78 | @classmethod |
79 | def validate_dbus_object(cls, path, state): |
80 | @@ -390,7 +386,7 @@ |
81 | |
82 | class TimeAndDatePage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
83 | |
84 | - """Autopilot helper for the Sound page.""" |
85 | + """Autopilot helper for the TimeAndDate page.""" |
86 | |
87 | @classmethod |
88 | def validate_dbus_object(cls, path, state): |
89 | @@ -421,7 +417,7 @@ |
90 | @classmethod |
91 | def validate_dbus_object(cls, path, state): |
92 | name = introspection.get_classname_from_path(path) |
93 | - if name == b'ItemPage': |
94 | + if name == b'PageComponent': |
95 | if state['objectName'][1] == 'aboutPage': |
96 | return True |
97 | return False |
98 | @@ -464,6 +460,7 @@ |
99 | def go_to_check_for_updates(self): |
100 | check_for_updates_button = self.select_single( |
101 | objectName='updateButton') |
102 | + check_for_updates_button.swipe_into_view() |
103 | self.pointing_device.click_object(check_for_updates_button) |
104 | system_updates_page = self.get_root_instance().wait_select_single( |
105 | objectName='systemUpdatesPage') |
106 | @@ -481,6 +478,10 @@ |
107 | licenses_page.active.wait_for(True) |
108 | return licenses_page |
109 | |
110 | + def get_number(self, obj): |
111 | + number = self.select_single(objectName=obj) |
112 | + return number.value |
113 | + |
114 | |
115 | class LicensesPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
116 | |
117 | @@ -576,6 +577,18 @@ |
118 | |
119 | return self._go_to_page(find, 'servicesPage') |
120 | |
121 | + @property |
122 | + def _dialpad_sounds(self): |
123 | + return self.wait_select_single( |
124 | + ubuntuuitoolkit.CheckBox, |
125 | + objectName='dialpadSounds') |
126 | + |
127 | + def enable_dialpad_sounds(self): |
128 | + self._dialpad_sounds.check() |
129 | + |
130 | + def disable_dialpad_sounds(self): |
131 | + self._dialpad_sounds.uncheck() |
132 | + |
133 | |
134 | class CallWaiting(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
135 | |
136 | |
137 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' |
138 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-12-01 15:24:55 +0000 |
139 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-01-08 21:37:23 +0000 |
140 | @@ -60,8 +60,9 @@ |
141 | def setUp(self, panel=None): |
142 | super(UbuntuSystemSettingsTestCase, self).setUp() |
143 | self.system_settings = SystemSettings(self, panel=panel) |
144 | + self.main_view = self.system_settings.main_view |
145 | self.assertThat( |
146 | - self.system_settings.main_view.visible, |
147 | + self.main_view.visible, |
148 | Eventually(Equals(True))) |
149 | |
150 | def set_orientation(self, gsettings, value): |
151 | @@ -109,10 +110,6 @@ |
152 | def setUp(self): |
153 | super(UbuntuSystemSettingsBatteryTestCase, self).setUp() |
154 | self.add_mock_battery() |
155 | - self.system_settings = SystemSettings(self) |
156 | - self.assertThat( |
157 | - self.system_settings.main_view.visible, |
158 | - Eventually(Equals(True))) |
159 | |
160 | |
161 | class UbuntuSystemSettingsOfonoTestCase(UbuntuSystemSettingsTestCase, |
162 | @@ -124,14 +121,14 @@ |
163 | @property |
164 | def choose_carrier_page(self): |
165 | """Return carrier selection page""" |
166 | - return self.system_settings.main_view.select_single( |
167 | + return self.main_view.select_single( |
168 | objectName='chooseCarrierPage' |
169 | ) |
170 | |
171 | @property |
172 | def choose_carriers_page(self): |
173 | """Return carriers selection page""" |
174 | - return self.system_settings.main_view.select_single( |
175 | + return self.main_view.select_single( |
176 | objectName='chooseCarriersPage' |
177 | ) |
178 | |
179 | @@ -289,6 +286,12 @@ |
180 | template, stdout=subprocess.PIPE) |
181 | cls.dbusmock = dbus.Interface(cls.obj_ofono, dbusmock.MOCK_IFACE) |
182 | |
183 | + @classmethod |
184 | + def tearDownClass(cls): |
185 | + super(UbuntuSystemSettingsOfonoTestCase, cls).tearDownClass() |
186 | + cls.p_mock.terminate() |
187 | + cls.p_mock.wait() |
188 | + |
189 | def setUp(self, panel=None): |
190 | self.obj_ofono.Reset() |
191 | |
192 | @@ -296,7 +299,7 @@ |
193 | if self.use_sims == 2: |
194 | self.add_sim2() |
195 | |
196 | - super(UbuntuSystemSettingsOfonoTestCase, self).setUp(panel) |
197 | + super(UbuntuSystemSettingsOfonoTestCase, self).setUp() |
198 | |
199 | def set_default_for_calls(self, gsettings, default): |
200 | gsettings.set_value('default-sim-for-calls', default) |
201 | @@ -309,12 +312,12 @@ |
202 | sleep(1) |
203 | |
204 | def get_default_sim_for_calls_selector(self, text): |
205 | - return self.system_settings.main_view.cellular_page.select_single( |
206 | + return self.cellular_page.select_single( |
207 | objectName="defaultForCalls" + text |
208 | ) |
209 | |
210 | def get_default_sim_for_messages_selector(self, text): |
211 | - return self.system_settings.main_view.cellular_page.select_single( |
212 | + return self.cellular_page.select_single( |
213 | objectName="defaultForMessages" + text |
214 | ) |
215 | |
216 | @@ -324,35 +327,28 @@ |
217 | def setUp(self): |
218 | """ Go to Cellular page """ |
219 | super(CellularBaseTestCase, self).setUp() |
220 | - self.cellular_page = self.system_settings.\ |
221 | - main_view.go_to_cellular_page() |
222 | + self.cellular_page = self.main_view.go_to_cellular_page() |
223 | |
224 | |
225 | class PhoneOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): |
226 | def setUp(self): |
227 | """ Go to Phone page """ |
228 | - super(PhoneOfonoBaseTestCase, self).setUp('phone') |
229 | - self.phone_page = self.system_settings.main_view.select_single( |
230 | - objectName='phonePage' |
231 | - ) |
232 | + super(PhoneOfonoBaseTestCase, self).setUp() |
233 | + self.phone_page = self.main_view.go_to_phone_page() |
234 | |
235 | |
236 | class AboutBaseTestCase(UbuntuSystemSettingsTestCase): |
237 | def setUp(self): |
238 | """Go to About page.""" |
239 | - super(AboutBaseTestCase, self).setUp('about') |
240 | - self.about_page = self.system_settings.main_view.select_single( |
241 | - objectName='aboutPage' |
242 | - ) |
243 | + super(AboutBaseTestCase, self).setUp() |
244 | + self.about_page = self.main_view.go_to_about_page() |
245 | |
246 | |
247 | class AboutOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): |
248 | def setUp(self): |
249 | """Go to About page.""" |
250 | - super(AboutOfonoBaseTestCase, self).setUp('about') |
251 | - self.about_page = self.system_settings.main_view.select_single( |
252 | - objectName='aboutPage' |
253 | - ) |
254 | + super(AboutOfonoBaseTestCase, self).setUp() |
255 | + self.about_page = self.main_view.go_to_about_page() |
256 | |
257 | |
258 | class AboutSystemImageBaseTestCase(AboutBaseTestCase, |
259 | @@ -396,12 +392,15 @@ |
260 | def setUp(self): |
261 | """Go to Storage Page.""" |
262 | super(StorageBaseTestCase, self).setUp() |
263 | - self.system_settings.main_view.click_item('storageItem') |
264 | + self.main_view.click_item('storageItem') |
265 | + self.storage_page = self.main_view.select_single( |
266 | + 'Storage', objectName='storagePage' |
267 | + ) |
268 | self.assertThat(self.storage_page.active, Eventually(Equals(True))) |
269 | |
270 | def assert_space_item(self, object_name, text): |
271 | """ Checks whether an space item exists and returns a value """ |
272 | - item = self.system_settings.main_view.storage_page.select_single( |
273 | + item = self.main_view.storage_page.select_single( |
274 | objectName=object_name |
275 | ) |
276 | self.assertThat(item, NotEquals(None)) |
277 | @@ -417,13 +416,6 @@ |
278 | return self.main_view.wait_select_single( |
279 | 'StorageItem', objectName=objectName).value |
280 | |
281 | - @property |
282 | - def storage_page(self): |
283 | - """ Return 'Storage' page """ |
284 | - return self.system_settings.main_view.select_single( |
285 | - 'Storage', objectName='storagePage' |
286 | - ) |
287 | - |
288 | |
289 | class LicenseBaseTestCase(AboutBaseTestCase): |
290 | |
291 | @@ -442,8 +434,7 @@ |
292 | def setUp(self): |
293 | """Go to SystemUpdates Page.""" |
294 | super(SystemUpdatesBaseTestCase, self).setUp() |
295 | - self.system_settings.main_view.click_item( |
296 | - 'entryComponent-system-update') |
297 | + self.main_view.click_item('entryComponent-system-update') |
298 | |
299 | |
300 | class BackgroundBaseTestCase( |
301 | @@ -515,7 +506,7 @@ |
302 | 'SYSTEM_SETTINGS_UBUNTU_ART_DIR', art_dir)) |
303 | |
304 | super(BackgroundBaseTestCase, self).setUp('background') |
305 | - self.assertThat(self.system_settings.main_view.background_page.active, |
306 | + self.assertThat(self.main_view.background_page.active, |
307 | Eventually(Equals(True))) |
308 | |
309 | def tearDown(self): |
310 | @@ -532,11 +523,14 @@ |
311 | @classmethod |
312 | def setUpClass(klass): |
313 | klass.start_system_bus() |
314 | - klass.start_session_bus() |
315 | klass.dbus_con = klass.get_dbus(True) |
316 | klass.dbus_con_session = klass.get_dbus(False) |
317 | |
318 | def setUp(self, panel='sound'): |
319 | + # TODO only do this if the sound indicator is running. |
320 | + # --elopio - 2015-01-08 |
321 | + self.stop_sound_indicator() |
322 | + self.addCleanup(self.start_sound_indicator) |
323 | |
324 | user_obj = '/user/foo' |
325 | |
326 | @@ -562,7 +556,9 @@ |
327 | GTK_ACTIONS_IFACE, |
328 | stdout=subprocess.PIPE) |
329 | |
330 | - sleep(2) |
331 | + self.wait_for_bus_object(ACCOUNTS_IFACE, |
332 | + ACCOUNTS_OBJ, |
333 | + system_bus=True) |
334 | |
335 | self.dbus_mock = dbus.Interface(self.dbus_con.get_object( |
336 | ACCOUNTS_IFACE, |
337 | @@ -570,6 +566,9 @@ |
338 | ACCOUNTS_IFACE), |
339 | dbusmock.MOCK_IFACE) |
340 | |
341 | + self.wait_for_bus_object(ISOUND_SERVICE, |
342 | + ISOUND_ACTION_PATH) |
343 | + |
344 | self.dbus_mock_isound = dbus.Interface( |
345 | self.dbus_con_session.get_object( |
346 | ISOUND_SERVICE, |
347 | @@ -626,8 +625,8 @@ |
348 | ACCOUNTS_SOUND_IFACE) |
349 | ]) |
350 | |
351 | - self.obj_test = self.dbus_con.get_object(ACCOUNTS_IFACE, user_obj, |
352 | - ACCOUNTS_IFACE) |
353 | + self.obj_snd = self.dbus_con.get_object(ACCOUNTS_IFACE, user_obj, |
354 | + ACCOUNTS_IFACE) |
355 | |
356 | self.dbus_mock_isound.AddMethods( |
357 | GTK_ACTIONS_IFACE, |
358 | @@ -661,9 +660,11 @@ |
359 | |
360 | super(SoundBaseTestCase, self).setUp(panel) |
361 | |
362 | - """ Go to Sound page """ |
363 | if panel == 'sound': |
364 | - self.assertThat(self.system_settings.main_view.sound_page.active, |
365 | + self.sound_page = self.main_view.select_single( |
366 | + objectName='soundPage' |
367 | + ) |
368 | + self.assertThat(self.sound_page.active, |
369 | Eventually(Equals(True))) |
370 | |
371 | def tearDown(self): |
372 | @@ -673,6 +674,12 @@ |
373 | self.mock_isound.wait() |
374 | super(SoundBaseTestCase, self).tearDown() |
375 | |
376 | + def start_sound_indicator(self): |
377 | + subprocess.call(['initctl', 'start', 'indicator-sound']) |
378 | + |
379 | + def stop_sound_indicator(self): |
380 | + subprocess.call(['initctl', 'stop', 'indicator-sound']) |
381 | + |
382 | |
383 | class ResetBaseTestCase(UbuntuSystemSettingsTestCase, |
384 | dbusmock.DBusTestCase): |
385 | @@ -698,7 +705,7 @@ |
386 | def setUp(self): |
387 | self.mock_for_factory_reset() |
388 | super(ResetBaseTestCase, self).setUp() |
389 | - self.reset_page = self.system_settings.main_view.go_to_reset_phone() |
390 | + self.reset_page = self.main_view.go_to_reset_phone() |
391 | |
392 | def tearDown(self): |
393 | self.mock_server.terminate() |
394 | @@ -710,30 +717,13 @@ |
395 | """ Base class for security and privacy settings tests""" |
396 | |
397 | def setUp(self): |
398 | - super(SecurityBaseTestCase, self).setUp('security-privacy') |
399 | - """ Go to Security & Privacy page """ |
400 | - self.security_page = self.system_settings.main_view.select_single( |
401 | - objectName='securityPrivacyPage' |
402 | - ) |
403 | - self.assertThat(self.security_page.active, |
404 | - Eventually(Equals(True))) |
405 | + super(SecurityBaseTestCase, self).setUp() |
406 | + self.security_page = self.main_view.go_to_security_page() |
407 | |
408 | def tearDown(self): |
409 | super(SecurityBaseTestCase, self).tearDown() |
410 | |
411 | |
412 | -class PhoneSoundBaseTestCase(SoundBaseTestCase): |
413 | - def setUp(self): |
414 | - """ Go to Phone page """ |
415 | - super(PhoneSoundBaseTestCase, self).setUp('phone') |
416 | - self.phone_page = self.system_settings.main_view.select_single( |
417 | - objectName='phonePage' |
418 | - ) |
419 | - |
420 | - def tearDown(self): |
421 | - super(PhoneSoundBaseTestCase, self).tearDown() |
422 | - |
423 | - |
424 | class LanguageBaseTestCase(UbuntuSystemSettingsTestCase, |
425 | dbusmock.DBusTestCase): |
426 | """ Base class for language settings tests""" |
427 | @@ -759,8 +749,7 @@ |
428 | self.mock_loginmanager() |
429 | |
430 | super(LanguageBaseTestCase, self).setUp() |
431 | - self.language_page = self.system_settings.\ |
432 | - main_view.go_to_language_page() |
433 | + self.language_page = self.main_view.go_to_language_page() |
434 | |
435 | def tearDown(self): |
436 | self.mock_server.terminate() |
437 | @@ -799,8 +788,7 @@ |
438 | pass |
439 | |
440 | super(WifiBaseTestCase, self).setUp() |
441 | - self.wifi_page = self.system_settings.\ |
442 | - main_view.go_to_wifi_page() |
443 | + self.wifi_page = self.main_view.go_to_wifi_page() |
444 | |
445 | def add_previous_networks(self, networks): |
446 | dev_path = str(self.obj_nm.GetDevices()[0]) |
447 | |
448 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_about.py' |
449 | --- tests/autopilot/ubuntu_system_settings/tests/test_about.py 2014-11-19 12:03:35 +0000 |
450 | +++ tests/autopilot/ubuntu_system_settings/tests/test_about.py 2015-01-08 21:37:23 +0000 |
451 | @@ -133,10 +133,8 @@ |
452 | self.assertThat(displayed_imei, Equals(device_imei)) |
453 | |
454 | def test_phone_number(self): |
455 | - number = self.system_settings.main_view.about_page.select_single( |
456 | - objectName="numberItem" |
457 | - ) |
458 | - self.assertEqual(str(number.value), "123456789") |
459 | + self.assertEqual(str(self.about_page.get_number('numberItem')), |
460 | + '123456789') |
461 | |
462 | |
463 | class AboutOfonoMultiSimTestCase(AboutOfonoBaseTestCase): |
464 | @@ -144,14 +142,10 @@ |
465 | use_sims = 2 |
466 | |
467 | def test_phone_numbers(self): |
468 | - number1 = self.system_settings.main_view.about_page.select_single( |
469 | - objectName="numberItem1" |
470 | - ) |
471 | - number2 = self.system_settings.main_view.about_page.select_single( |
472 | - objectName="numberItem2" |
473 | - ) |
474 | - self.assertEqual(str(number1.value), "123456789") |
475 | - self.assertEqual(str(number2.value), "08123") |
476 | + self.assertEqual(str(self.about_page.get_number('numberItem1')), |
477 | + '123456789') |
478 | + self.assertEqual(str(self.about_page.get_number('numberItem2')), |
479 | + '08123') |
480 | |
481 | |
482 | class AboutSystemImageTestCase(AboutSystemImageBaseTestCase): |
483 | @@ -219,7 +213,7 @@ |
484 | |
485 | def test_disk(self): |
486 | """ Checks whether disk item is available """ |
487 | - disk_item = self.system_settings.main_view.storage_page.select_single( |
488 | + disk_item = self.storage_page.select_single( |
489 | objectName='diskItem' |
490 | ) |
491 | self.assertThat(disk_item.text, Equals('Total storage')) |
492 | @@ -286,8 +280,9 @@ |
493 | |
494 | def test_installed_apps(self): |
495 | """ Checks whether Installed Apps list is available """ |
496 | - installed_apps_list_view = self.system_settings.main_view.\ |
497 | - storage_page.select_single(objectName='installedAppsListView') |
498 | + installed_apps_list_view = self.storage_page.select_single( |
499 | + objectName='installedAppsListView' |
500 | + ) |
501 | self.assertThat(installed_apps_list_view, NotEquals(None)) |
502 | |
503 | |
504 | |
505 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_background.py' |
506 | --- tests/autopilot/ubuntu_system_settings/tests/test_background.py 2014-07-22 21:44:35 +0000 |
507 | +++ tests/autopilot/ubuntu_system_settings/tests/test_background.py 2015-01-08 21:37:23 +0000 |
508 | @@ -24,7 +24,7 @@ |
509 | |
510 | def setUp(self): |
511 | super(BackgroundTestCase, self).setUp() |
512 | - self.background_page = self.system_settings.main_view.background_page |
513 | + self.background_page = self.main_view.background_page |
514 | |
515 | def get_wallpapergrid(self, name): |
516 | """Return a WallpaperGrid with given name, or |
517 | @@ -64,9 +64,9 @@ |
518 | |
519 | def save_wallpaper(self): |
520 | """Click on Set/Save button when previewing a wallpaper""" |
521 | - save = self.system_settings.main_view.wait_select_single( |
522 | + save = self.main_view.wait_select_single( |
523 | objectName='saveButton') |
524 | - self.system_settings.main_view.scroll_to_and_click(save) |
525 | + self.main_view.scroll_to_and_click(save) |
526 | |
527 | def test_background_page_title_is_correct(self): |
528 | """ Checks whether Background page is available """ |
529 | @@ -79,7 +79,7 @@ |
530 | old = self.selected_wallpaper.source |
531 | |
532 | # click a wallpaper that is not selected |
533 | - self.system_settings.main_view.scroll_to_and_click( |
534 | + self.main_view.scroll_to_and_click( |
535 | self.all_wallpapers[3]) |
536 | |
537 | # click set/save |
538 | @@ -112,5 +112,5 @@ |
539 | objectName='CustomHeader') |
540 | |
541 | self.assertEqual(custom.state, 'collapsed') |
542 | - self.system_settings.main_view.scroll_to_and_click(custom_header) |
543 | + self.main_view.scroll_to_and_click(custom_header) |
544 | self.assertEqual(custom.state, '') |
545 | |
546 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_datetime.py' |
547 | --- tests/autopilot/ubuntu_system_settings/tests/test_datetime.py 2014-11-25 20:19:27 +0000 |
548 | +++ tests/autopilot/ubuntu_system_settings/tests/test_datetime.py 2015-01-08 21:37:23 +0000 |
549 | @@ -39,17 +39,12 @@ |
550 | def setUp(self): |
551 | """ Go to Time & Date page """ |
552 | self.obj_timedate1.Reset() |
553 | - super(TimeDateTestCase, self).setUp("time-date") |
554 | - |
555 | - @property |
556 | - def time_date_page(self): |
557 | - return self.system_settings.main_view.select_single( |
558 | - objectName='timeDatePage' |
559 | - ) |
560 | + super(TimeDateTestCase, self).setUp() |
561 | + self.page = self.main_view.go_to_datetime_page() |
562 | |
563 | @property |
564 | def tz_page(self): |
565 | - return self.system_settings.main_view.select_single( |
566 | + return self.main_view.select_single( |
567 | objectName='timeZone' |
568 | ) |
569 | |
570 | @@ -67,22 +62,22 @@ |
571 | raise e |
572 | |
573 | def click_tz_search_field(self): |
574 | - self.system_settings.main_view.scroll_to_and_click(self.tz_page) |
575 | - text_field = self.system_settings.main_view.wait_select_single( |
576 | + self.main_view.scroll_to_and_click(self.tz_page) |
577 | + text_field = self.main_view.wait_select_single( |
578 | objectName='selectTimeZoneField' |
579 | ) |
580 | - self.system_settings.main_view.pointing_device.move_to_object( |
581 | + self.main_view.pointing_device.move_to_object( |
582 | text_field) |
583 | |
584 | def test_time_date_page(self): |
585 | """ Checks whether Time & Date page is available """ |
586 | - self.assertThat(self.time_date_page, NotEquals(None)) |
587 | - self.assertThat(self.time_date_page.title, Equals(_('Time & Date'))) |
588 | + self.assertThat(self.page, NotEquals(None)) |
589 | + self.assertThat(self.page.title, Equals(_('Time & Date'))) |
590 | |
591 | def test_tz_list_initially_empty(self): |
592 | """ Checks that no list is displayed initially """ |
593 | - self.system_settings.main_view.scroll_to_and_click(self.tz_page) |
594 | - labelVisible = self.system_settings.main_view.wait_select_single( |
595 | + self.main_view.scroll_to_and_click(self.tz_page) |
596 | + labelVisible = self.main_view.wait_select_single( |
597 | objectName='nothingLabel').visible |
598 | self.assertThat(labelVisible, Equals(True)) |
599 | |
600 | @@ -90,7 +85,7 @@ |
601 | """ Check that searching for a valid location shows something """ |
602 | self.click_tz_search_field() |
603 | self.keyboard.type('London, United Kingdom') |
604 | - listview = self.system_settings.main_view.select_single( |
605 | + listview = self.main_view.select_single( |
606 | objectName='locationsListView' |
607 | ) |
608 | self.assertThat(listview.count, Eventually(GreaterThan(0))) |
609 | @@ -99,11 +94,11 @@ |
610 | """ Check that searching for an invalid location shows nothing """ |
611 | self.click_tz_search_field() |
612 | self.keyboard.type('Oh no you don\'t!') |
613 | - listview = self.system_settings.main_view.select_single( |
614 | + listview = self.main_view.select_single( |
615 | objectName='locationsListView' |
616 | ) |
617 | self.assertThat(listview.count, Equals(0)) |
618 | - labelVisible = self.system_settings.main_view.select_single( |
619 | + labelVisible = self.main_view.select_single( |
620 | objectName='nothingLabel').visible |
621 | self.assertThat(labelVisible, Equals(True)) |
622 | |
623 | @@ -111,12 +106,12 @@ |
624 | """ Check that manually selecting a timezone sets it properly """ |
625 | self.click_tz_search_field() |
626 | self.keyboard.type('London, United Kingdom') |
627 | - listview = self.system_settings.main_view.select_single( |
628 | + listview = self.main_view.select_single( |
629 | objectName='locationsListView' |
630 | ) |
631 | london = TimeDateTestCase.wait_select_listview_first(listview) |
632 | - self.system_settings.main_view.pointing_device.click_object(london) |
633 | - header = self.system_settings.main_view.select_single( |
634 | + self.main_view.pointing_device.click_object(london) |
635 | + header = self.main_view.select_single( |
636 | objectName='MainView_Header' |
637 | ) |
638 | self.assertThat(header.title, Eventually(Equals(_('Time & Date')))) |
639 | @@ -130,16 +125,16 @@ |
640 | self.click_tz_search_field() |
641 | # This is also in Europe/London |
642 | self.keyboard.type('Preston, United Kingdom') |
643 | - listview = self.system_settings.main_view.select_single( |
644 | + listview = self.main_view.select_single( |
645 | objectName='locationsListView' |
646 | ) |
647 | |
648 | preston = TimeDateTestCase.wait_select_listview_first(listview) |
649 | - self.system_settings.main_view.pointing_device.click_object(preston) |
650 | + self.main_view.pointing_device.click_object(preston) |
651 | |
652 | # The timer is 1 second, wait and see that we haven't moved pages |
653 | sleep(2) |
654 | - header = self.system_settings.main_view.select_single( |
655 | + header = self.main_view.select_single( |
656 | objectName='MainView_Header' |
657 | ) |
658 | self.assertThat(header.title, Eventually(Equals(_('Time zone')))) |
659 | |
660 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_main.py' |
661 | --- tests/autopilot/ubuntu_system_settings/tests/test_main.py 2014-08-25 12:33:13 +0000 |
662 | +++ tests/autopilot/ubuntu_system_settings/tests/test_main.py 2015-01-08 21:37:23 +0000 |
663 | @@ -26,8 +26,8 @@ |
664 | self.addCleanup( |
665 | self.set_orientation, gsettings, GLib.Variant('b', current)) |
666 | |
667 | - self.system_settings.main_view.disable_orientation_lock() |
668 | - self.system_settings.main_view.enable_orientation_lock() |
669 | + self.main_view.disable_orientation_lock() |
670 | + self.main_view.enable_orientation_lock() |
671 | |
672 | self.assertThat( |
673 | lambda: gsettings.get_value('rotation-lock').get_boolean(), |
674 | @@ -40,8 +40,8 @@ |
675 | self.addCleanup( |
676 | self.set_orientation, gsettings, GLib.Variant('b', current)) |
677 | |
678 | - self.system_settings.main_view.enable_orientation_lock() |
679 | - self.system_settings.main_view.disable_orientation_lock() |
680 | + self.main_view.enable_orientation_lock() |
681 | + self.main_view.disable_orientation_lock() |
682 | |
683 | self.assertThat( |
684 | lambda: gsettings.get_value('rotation-lock').get_boolean(), |
685 | |
686 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_phone.py' |
687 | --- tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2014-08-28 17:33:40 +0000 |
688 | +++ tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-01-08 21:37:23 +0000 |
689 | @@ -8,22 +8,20 @@ |
690 | from __future__ import absolute_import |
691 | |
692 | from autopilot.matchers import Eventually |
693 | -from testtools.matchers import Contains, Equals, NotEquals |
694 | +from testtools.matchers import Contains, Equals |
695 | |
696 | from ubuntu_system_settings.tests import ( |
697 | PhoneOfonoBaseTestCase, |
698 | - PhoneSoundBaseTestCase, |
699 | CALL_FWD_IFACE, |
700 | CALL_SETTINGS_IFACE |
701 | ) |
702 | |
703 | |
704 | class PhoneTestCase(PhoneOfonoBaseTestCase): |
705 | - """Tests for Phone Page""" |
706 | |
707 | def test_call_fwd(self): |
708 | call_fwd_page = self.phone_page.go_to_call_forwarding() |
709 | - call_fwd_page.set_forward("41444424") |
710 | + call_fwd_page.set_forward('41444424') |
711 | |
712 | # Check that the forward has been set |
713 | self.assertThat( |
714 | @@ -52,7 +50,6 @@ |
715 | |
716 | |
717 | class PhoneDualSimTestCase(PhoneOfonoBaseTestCase): |
718 | - """Tests for Phone Page""" |
719 | |
720 | use_sims = 2 |
721 | |
722 | @@ -73,7 +70,7 @@ |
723 | |
724 | def test_call_fwd_sim_2(self): |
725 | call_fwd_page = self.phone_page.go_to_call_forwarding(sim=2) |
726 | - call_fwd_page.set_forward("41444424") |
727 | + call_fwd_page.set_forward('41444424') |
728 | |
729 | # Check that the forward has been set |
730 | self.assertThat( |
731 | @@ -113,17 +110,3 @@ |
732 | lambda: str(self.modem_1.Get(CALL_SETTINGS_IFACE, |
733 | 'VoiceCallWaiting')), |
734 | Eventually(Contains('enabled'))) |
735 | - |
736 | - |
737 | -class PhoneSoundTestCase(PhoneSoundBaseTestCase): |
738 | - """Tests for Phone Page""" |
739 | - |
740 | - def test_dialpad_sounds_switch(self): |
741 | - """ Check that dialpad_sounds is present and clickable""" |
742 | - snd = self.phone_page.select_single( |
743 | - objectName="dialpadSounds") |
744 | - prev_value = self.obj_test.GetDialpadSoundsEnabled() |
745 | - self.system_settings.main_view.scroll_to_and_click(snd) |
746 | - self.assertThat( |
747 | - lambda: self.obj_test.GetDialpadSoundsEnabled(), |
748 | - Eventually(NotEquals(prev_value))) |
749 | |
750 | === added file 'tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py' |
751 | --- tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py 1970-01-01 00:00:00 +0000 |
752 | +++ tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py 2015-01-08 21:37:23 +0000 |
753 | @@ -0,0 +1,32 @@ |
754 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
755 | +# Copyright 2014 Canonical |
756 | +# |
757 | +# This program is free software: you can redistribute it and/or modify it |
758 | +# under the terms of the GNU General Public License version 3, as published |
759 | +# by the Free Software Foundation. |
760 | + |
761 | +from __future__ import absolute_import |
762 | + |
763 | +from autopilot.matchers import Eventually |
764 | +from testtools.matchers import NotEquals |
765 | + |
766 | +from ubuntu_system_settings.tests import SoundBaseTestCase |
767 | + |
768 | + |
769 | +class PhoneSoundTestCase(SoundBaseTestCase): |
770 | + """Tests for Phone Page""" |
771 | + |
772 | + def setUp(self): |
773 | + super(PhoneSoundTestCase, self).setUp(panel=None) |
774 | + self.page = self.main_view.go_to_phone_page() |
775 | + |
776 | + def test_dialpad_sounds_switch(self): |
777 | + """ Check that dialpad_sounds is present and clickable""" |
778 | + prev_value = self.obj_snd.GetDialpadSoundsEnabled() |
779 | + if not prev_value: |
780 | + self.page.enable_dialpad_sounds() |
781 | + else: |
782 | + self.page.disable_dialpad_sounds() |
783 | + self.assertThat( |
784 | + lambda: self.obj_snd.GetDialpadSoundsEnabled(), |
785 | + Eventually(NotEquals(prev_value))) |
786 | |
787 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_plugins.py' |
788 | --- tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2014-04-04 15:31:49 +0000 |
789 | +++ tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2015-01-08 21:37:23 +0000 |
790 | @@ -25,7 +25,7 @@ |
791 | |
792 | def test_title(self): |
793 | """ Checks whether the app title is correct """ |
794 | - header = self.system_settings.main_view.select_single( |
795 | + header = self.main_view.select_single( |
796 | objectName='systemSettingsPage' |
797 | ) |
798 | self.assertThat(header, NotEquals(None)) |
799 | @@ -33,14 +33,14 @@ |
800 | |
801 | def test_search(self): |
802 | """ Checks whether the Search box is available """ |
803 | - search = self.system_settings.main_view.select_single( |
804 | + search = self.main_view.select_single( |
805 | objectName='searchTextField' |
806 | ) |
807 | self.assertThat(search, NotEquals(None)) |
808 | |
809 | def test_network_category(self): |
810 | """ Checks whether the Network category is available """ |
811 | - category = self.system_settings.main_view.select_single( |
812 | + category = self.main_view.select_single( |
813 | objectName='categoryGrid-network' |
814 | ) |
815 | self.assertThat(category, NotEquals(None)) |
816 | @@ -50,7 +50,7 @@ |
817 | |
818 | def test_personal_category(self): |
819 | """ Checks whether the Personal category is available """ |
820 | - category = self.system_settings.main_view.select_single( |
821 | + category = self.main_view.select_single( |
822 | objectName='categoryGrid-personal' |
823 | ) |
824 | self.assertThat(category, NotEquals(None)) |
825 | @@ -60,7 +60,7 @@ |
826 | |
827 | def test_system_category(self): |
828 | """ Checks whether the System category is available """ |
829 | - category = self.system_settings.main_view.select_single( |
830 | + category = self.main_view.select_single( |
831 | objectName='categoryGrid-system' |
832 | ) |
833 | self.assertThat(category, NotEquals(None)) |
834 | @@ -68,70 +68,70 @@ |
835 | |
836 | def test_wifi_plugin(self): |
837 | """ Checks whether the Wi-Fi plugin is available """ |
838 | - plugin = self.system_settings.main_view.select_single( |
839 | + plugin = self.main_view.select_single( |
840 | objectName='entryComponent-wifi' |
841 | ) |
842 | self.assertThat(plugin, NotEquals(None)) |
843 | |
844 | def test_cellular_plugin(self): |
845 | """ Checks whether the Cellunar plugin is available """ |
846 | - plugin = self.system_settings.main_view.select_single( |
847 | + plugin = self.main_view.select_single( |
848 | objectName='entryComponent-cellular' |
849 | ) |
850 | self.assertThat(plugin, NotEquals(None)) |
851 | |
852 | def test_bluetooth_plugin(self): |
853 | """ Checks whether the Bluetooth plugin is available """ |
854 | - plugin = self.system_settings.main_view.select_single( |
855 | + plugin = self.main_view.select_single( |
856 | objectName='entryComponent-bluetooth' |
857 | ) |
858 | self.assertThat(plugin, NotEquals(None)) |
859 | |
860 | def test_background_plugin(self): |
861 | """ Checks whether the Background plugin is available """ |
862 | - plugin = self.system_settings.main_view.select_single( |
863 | + plugin = self.main_view.select_single( |
864 | objectName='entryComponent-background' |
865 | ) |
866 | self.assertThat(plugin, NotEquals(None)) |
867 | |
868 | def test_sound_plugin(self): |
869 | """ Checks whether the Sound plugin is available """ |
870 | - plugin = self.system_settings.main_view.select_single( |
871 | + plugin = self.main_view.select_single( |
872 | objectName='entryComponent-sound' |
873 | ) |
874 | self.assertThat(plugin, NotEquals(None)) |
875 | |
876 | def test_language_plugin(self): |
877 | """ Checks whether the Language plugin is available """ |
878 | - plugin = self.system_settings.main_view.select_single( |
879 | + plugin = self.main_view.select_single( |
880 | objectName='entryComponent-language' |
881 | ) |
882 | self.assertThat(plugin, NotEquals(None)) |
883 | |
884 | def test_accounts_plugin(self): |
885 | """ Checks whether the Accounts plugin is available """ |
886 | - plugin = self.system_settings.main_view.select_single( |
887 | + plugin = self.main_view.select_single( |
888 | objectName='entryComponent-online-accounts' |
889 | ) |
890 | self.assertThat(plugin, NotEquals(None)) |
891 | |
892 | def test_timedate_plugin(self): |
893 | """ Checks whether the Time & Date plugin is available """ |
894 | - plugin = self.system_settings.main_view.select_single( |
895 | + plugin = self.main_view.select_single( |
896 | objectName='entryComponent-time-date' |
897 | ) |
898 | self.assertThat(plugin, NotEquals(None)) |
899 | |
900 | def test_security_plugin(self): |
901 | """ Checks whether the Security plugin is available """ |
902 | - plugin = self.system_settings.main_view.select_single( |
903 | + plugin = self.main_view.select_single( |
904 | objectName='entryComponent-security-privacy' |
905 | ) |
906 | self.assertThat(plugin, NotEquals(None)) |
907 | |
908 | def test_updates_plugin(self): |
909 | """ Checks whether the Updates plugin is available """ |
910 | - plugin = self.system_settings.main_view.select_single( |
911 | + plugin = self.main_view.select_single( |
912 | objectName='entryComponent-system-update' |
913 | ) |
914 | self.assertThat(plugin, NotEquals(None)) |
915 | @@ -144,7 +144,7 @@ |
916 | def test_no_battery_plugin_without_battery(self): |
917 | """ Checks whether the Battery plugin is not available |
918 | as we have no battery """ |
919 | - self.assertThat(lambda: self.system_settings.main_view.select_single( |
920 | + self.assertThat(lambda: self.main_view.select_single( |
921 | objectName='entryComponent-battery'), |
922 | raises(StateNotFoundError) |
923 | ) |
924 | @@ -152,7 +152,7 @@ |
925 | def test_battery_plugin_battery_hotplugging(self): |
926 | """ Checks whether hotplugging a battery makes the panel visible """ |
927 | self.add_mock_battery() |
928 | - plugin = self.system_settings.main_view.select_single( |
929 | + plugin = self.main_view.select_single( |
930 | objectName='entryComponent-battery' |
931 | ) |
932 | self.assertThat(plugin, NotEquals(None)) |
933 | @@ -164,7 +164,7 @@ |
934 | |
935 | def test_battery_plugin(self): |
936 | """ Checks whether the Battery plugin is available """ |
937 | - plugin = self.system_settings.main_view.select_single( |
938 | + plugin = self.main_view.select_single( |
939 | objectName='entryComponent-battery' |
940 | ) |
941 | self.assertThat(plugin, NotEquals(None)) |
942 | |
943 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_search.py' |
944 | --- tests/autopilot/ubuntu_system_settings/tests/test_search.py 2014-08-22 16:20:46 +0000 |
945 | +++ tests/autopilot/ubuntu_system_settings/tests/test_search.py 2015-01-08 21:37:23 +0000 |
946 | @@ -22,19 +22,19 @@ |
947 | super(SearchTestCases, self).setUp() |
948 | |
949 | def _get_entry_component(self, name): |
950 | - return self.system_settings.main_view.wait_select_single( |
951 | + return self.main_view.wait_select_single( |
952 | objectName='entryComponent-' + name |
953 | ) |
954 | |
955 | def _get_all_entry_components(self): |
956 | - return self.system_settings.main_view.select_many( |
957 | + return self.main_view.select_many( |
958 | 'EntryComponent') |
959 | |
960 | def _type_into_search_box(self, text): |
961 | - search_box = self.system_settings.main_view.select_single( |
962 | + search_box = self.main_view.select_single( |
963 | objectName='searchTextField' |
964 | ) |
965 | - self.system_settings.main_view.scroll_to_and_click(search_box) |
966 | + self.main_view.scroll_to_and_click(search_box) |
967 | self.keyboard.type(_(text)) |
968 | self.assertThat(search_box.text, Eventually(Equals(text))) |
969 | |
970 | |
971 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_security.py' |
972 | --- tests/autopilot/ubuntu_system_settings/tests/test_security.py 2014-08-27 16:13:12 +0000 |
973 | +++ tests/autopilot/ubuntu_system_settings/tests/test_security.py 2015-01-08 21:37:23 +0000 |
974 | @@ -25,7 +25,7 @@ |
975 | def setUp(self): |
976 | super(SecurityTestCase, self).setUp() |
977 | self.assertEqual(['pin'], self.modem_0.Get(SIM_IFACE, 'LockedPins')) |
978 | - prps = self.system_settings.main_view.security_page.get_properties() |
979 | + prps = self.security_page.get_properties() |
980 | self.use_powerd = prps['usePowerd'] |
981 | if self.use_powerd: |
982 | gsettings = Gio.Settings.new('com.ubuntu.touch.system') |
983 | @@ -64,47 +64,49 @@ |
984 | |
985 | def _go_to_phone_lock(self): |
986 | selector = self.security_page.select_single( |
987 | - objectName="lockingControl" |
988 | + objectName='lockingControl' |
989 | ) |
990 | - self.system_settings.main_view.scroll_to_and_click(selector) |
991 | + self.main_view.scroll_to_and_click(selector) |
992 | |
993 | def _go_to_sim_lock(self): |
994 | selector = self.security_page.select_single( |
995 | - objectName="simControl" |
996 | + objectName='simControl' |
997 | ) |
998 | - self.system_settings.main_view.scroll_to_and_click(selector) |
999 | + self.main_view.scroll_to_and_click(selector) |
1000 | |
1001 | def _go_to_sleep_values(self): |
1002 | self._go_to_phone_lock() |
1003 | - selector = self.system_settings.main_view.select_single( |
1004 | - objectName="lockTimeout" |
1005 | + selector = self.main_view.select_single( |
1006 | + objectName='lockTimeout' |
1007 | ) |
1008 | - self.system_settings.main_view.scroll_to_and_click(selector) |
1009 | + self.main_view.scroll_to_and_click(selector) |
1010 | |
1011 | def _get_sleep_selector(self): |
1012 | self._go_to_sleep_values() |
1013 | - sleep_values_page = self.system_settings.main_view.select_single( |
1014 | - objectName='sleepValues') |
1015 | + sleep_values_page = self.main_view.select_single( |
1016 | + objectName='sleepValues' |
1017 | + ) |
1018 | self.assertThat( |
1019 | sleep_values_page, |
1020 | NotEquals(None) |
1021 | ) |
1022 | self._go_to_sleep_values() |
1023 | - sleep_values_page = self.system_settings.main_view.select_single( |
1024 | - objectName='sleepValues') |
1025 | + sleep_values_page = self.main_view.select_single( |
1026 | + objectName='sleepValues' |
1027 | + ) |
1028 | return sleep_values_page.select_single( |
1029 | toolkit_emulators.ItemSelector, |
1030 | - objectName="sleepSelector" |
1031 | + objectName='sleepSelector' |
1032 | ) |
1033 | |
1034 | def test_security_page(self): |
1035 | """ Checks whether Security page is available """ |
1036 | self.assertThat( |
1037 | - self.system_settings.main_view.security_page, |
1038 | + self.security_page, |
1039 | NotEquals(None) |
1040 | ) |
1041 | self.assertThat( |
1042 | - self.system_settings.main_view.security_page.title, |
1043 | + self.security_page.title, |
1044 | Equals(_('Security & Privacy')) |
1045 | ) |
1046 | |
1047 | @@ -125,8 +127,9 @@ |
1048 | |
1049 | def test_phone_lock_page(self): |
1050 | self._go_to_phone_lock() |
1051 | - phone_lock_page = self.system_settings.main_view.select_single( |
1052 | - objectName='phoneLockingPage') |
1053 | + phone_lock_page = self.main_view.select_single( |
1054 | + objectName='phoneLockingPage' |
1055 | + ) |
1056 | self.assertThat( |
1057 | phone_lock_page, |
1058 | NotEquals(None) |
1059 | @@ -138,8 +141,9 @@ |
1060 | |
1061 | def test_phone_lock_value(self): |
1062 | self._go_to_phone_lock() |
1063 | - phone_lock_page = self.system_settings.main_view.select_single( |
1064 | - objectName='phoneLockingPage') |
1065 | + phone_lock_page = self.main_view.select_single( |
1066 | + objectName='phoneLockingPage' |
1067 | + ) |
1068 | actTimeout = self._get_activity_timeout() |
1069 | activityTimeout = phone_lock_page.select_single( |
1070 | objectName='lockTimeout').value |
1071 | @@ -160,7 +164,7 @@ |
1072 | selector = self._get_sleep_selector() |
1073 | to_select = selector.select_single( |
1074 | 'OptionSelectorDelegate', text='Never') |
1075 | - self.system_settings.main_view.pointing_device.click_object(to_select) |
1076 | + self.main_view.pointing_device.click_object(to_select) |
1077 | to_select.selected.wait_for(True) |
1078 | sleep(1) |
1079 | actTimeout = self._get_activity_timeout() |
1080 | @@ -173,7 +177,7 @@ |
1081 | selector = self._get_sleep_selector() |
1082 | to_select = selector.select_single( |
1083 | 'OptionSelectorDelegate', text='After 4 minutes') |
1084 | - self.system_settings.main_view.pointing_device.click_object(to_select) |
1085 | + self.main_view.pointing_device.click_object(to_select) |
1086 | to_select.selected.wait_for(True) |
1087 | sleep(1) |
1088 | actTimeout = self._get_activity_timeout() |
1089 | @@ -196,31 +200,36 @@ |
1090 | |
1091 | def test_sim_pin_lock_control(self): |
1092 | self._go_to_sim_lock() |
1093 | - sim_lock_control = self.system_settings.main_view.select_single( |
1094 | - objectName='simPinSwitch') |
1095 | + sim_lock_control = self.main_view.select_single( |
1096 | + objectName='simPinSwitch' |
1097 | + ) |
1098 | locked = len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1099 | self.assertEquals(locked, sim_lock_control.checked) |
1100 | |
1101 | def test_sim_pin_lock_control_unlock(self): |
1102 | self._go_to_sim_lock() |
1103 | - sim_lock_control = self.system_settings.main_view.select_single( |
1104 | - objectName='simPinSwitch') |
1105 | + sim_lock_control = self.main_view.select_single( |
1106 | + objectName='simPinSwitch' |
1107 | + ) |
1108 | |
1109 | self.assertTrue(sim_lock_control.checked) |
1110 | |
1111 | - self.system_settings.main_view.scroll_to_and_click(sim_lock_control) |
1112 | + self.main_view.scroll_to_and_click(sim_lock_control) |
1113 | |
1114 | - lock_dialog = self.system_settings.main_view.select_single( |
1115 | - objectName='lockDialogComponent') |
1116 | + lock_dialog = self.main_view.select_single( |
1117 | + objectName='lockDialogComponent' |
1118 | + ) |
1119 | self.assertEqual( |
1120 | lock_dialog.title, |
1121 | _("Enter SIM PIN") |
1122 | ) |
1123 | |
1124 | - prev_input = self.system_settings.main_view.select_single( |
1125 | - objectName='prevInput') |
1126 | - submit_button = self.system_settings.main_view.select_single( |
1127 | - objectName='lockButton') |
1128 | + prev_input = self.main_view.select_single( |
1129 | + objectName='prevInput' |
1130 | + ) |
1131 | + submit_button = self.main_view.select_single( |
1132 | + objectName='lockButton' |
1133 | + ) |
1134 | |
1135 | self.assertEqual( |
1136 | submit_button.text, |
1137 | @@ -230,7 +239,7 @@ |
1138 | self.assertFalse( |
1139 | submit_button.get_properties()['enabled'] |
1140 | ) |
1141 | - self.system_settings.main_view.scroll_to_and_click(prev_input) |
1142 | + self.main_view.scroll_to_and_click(prev_input) |
1143 | self.keyboard.type("246") |
1144 | self.assertFalse( |
1145 | submit_button.get_properties()['enabled'] |
1146 | @@ -241,7 +250,7 @@ |
1147 | submit_button.get_properties()['enabled'] |
1148 | ) |
1149 | |
1150 | - self.system_settings.main_view.scroll_to_and_click(submit_button) |
1151 | + self.main_view.scroll_to_and_click(submit_button) |
1152 | |
1153 | self.assertFalse(sim_lock_control.checked) |
1154 | |
1155 | @@ -252,24 +261,28 @@ |
1156 | def test_sim_pin_lock_control_lock(self): |
1157 | self.modem_0.Set(SIM_IFACE, 'LockedPins', "") |
1158 | self._go_to_sim_lock() |
1159 | - sim_lock_control = self.system_settings.main_view.select_single( |
1160 | - objectName='simPinSwitch') |
1161 | + sim_lock_control = self.main_view.select_single( |
1162 | + objectName='simPinSwitch' |
1163 | + ) |
1164 | |
1165 | self.assertFalse(sim_lock_control.checked) |
1166 | |
1167 | - self.system_settings.main_view.scroll_to_and_click(sim_lock_control) |
1168 | + self.main_view.scroll_to_and_click(sim_lock_control) |
1169 | |
1170 | - lock_dialog = self.system_settings.main_view.select_single( |
1171 | - objectName='lockDialogComponent') |
1172 | + lock_dialog = self.main_view.select_single( |
1173 | + objectName='lockDialogComponent' |
1174 | + ) |
1175 | self.assertEqual( |
1176 | lock_dialog.title, |
1177 | _("Enter SIM PIN") |
1178 | ) |
1179 | |
1180 | - prev_input = self.system_settings.main_view.select_single( |
1181 | - objectName='prevInput') |
1182 | - submit_button = self.system_settings.main_view.select_single( |
1183 | - objectName='lockButton') |
1184 | + prev_input = self.main_view.select_single( |
1185 | + objectName='prevInput' |
1186 | + ) |
1187 | + submit_button = self.main_view.select_single( |
1188 | + objectName='lockButton' |
1189 | + ) |
1190 | |
1191 | self.assertEqual( |
1192 | submit_button.text, |
1193 | @@ -279,7 +292,7 @@ |
1194 | self.assertFalse( |
1195 | submit_button.get_properties()['enabled'] |
1196 | ) |
1197 | - self.system_settings.main_view.scroll_to_and_click(prev_input) |
1198 | + self.main_view.scroll_to_and_click(prev_input) |
1199 | self.keyboard.type("246") |
1200 | self.assertFalse( |
1201 | submit_button.get_properties()['enabled'] |
1202 | @@ -290,7 +303,7 @@ |
1203 | submit_button.get_properties()['enabled'] |
1204 | ) |
1205 | |
1206 | - self.system_settings.main_view.scroll_to_and_click(submit_button) |
1207 | + self.main_view.scroll_to_and_click(submit_button) |
1208 | |
1209 | self.assertTrue(sim_lock_control.checked) |
1210 | |
1211 | @@ -300,27 +313,31 @@ |
1212 | |
1213 | def test_sim_pin_lock_control_unlock_fail(self): |
1214 | self._go_to_sim_lock() |
1215 | - sim_lock_control = self.system_settings.main_view.select_single( |
1216 | - objectName='simPinSwitch') |
1217 | + sim_lock_control = self.main_view.select_single( |
1218 | + objectName='simPinSwitch' |
1219 | + ) |
1220 | |
1221 | self.assertTrue( |
1222 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1223 | ) |
1224 | self.assertTrue(sim_lock_control.checked) |
1225 | |
1226 | - self.system_settings.main_view.scroll_to_and_click(sim_lock_control) |
1227 | + self.main_view.scroll_to_and_click(sim_lock_control) |
1228 | |
1229 | - lock_dialog = self.system_settings.main_view.select_single( |
1230 | - objectName='lockDialogComponent') |
1231 | + lock_dialog = self.main_view.select_single( |
1232 | + objectName='lockDialogComponent' |
1233 | + ) |
1234 | self.assertEqual( |
1235 | lock_dialog.title, |
1236 | _("Enter SIM PIN") |
1237 | ) |
1238 | |
1239 | - prev_input = self.system_settings.main_view.select_single( |
1240 | - objectName='prevInput') |
1241 | - submit_button = self.system_settings.main_view.select_single( |
1242 | - objectName='lockButton') |
1243 | + prev_input = self.main_view.select_single( |
1244 | + objectName='prevInput' |
1245 | + ) |
1246 | + submit_button = self.main_view.select_single( |
1247 | + objectName='lockButton' |
1248 | + ) |
1249 | |
1250 | self.assertEqual( |
1251 | submit_button.text, |
1252 | @@ -330,14 +347,14 @@ |
1253 | self.assertFalse( |
1254 | submit_button.get_properties()['enabled'] |
1255 | ) |
1256 | - self.system_settings.main_view.scroll_to_and_click(prev_input) |
1257 | + self.main_view.scroll_to_and_click(prev_input) |
1258 | self.keyboard.type("1234") |
1259 | |
1260 | self.assertTrue( |
1261 | submit_button.get_properties()['enabled'] |
1262 | ) |
1263 | |
1264 | - self.system_settings.main_view.scroll_to_and_click(submit_button) |
1265 | + self.main_view.scroll_to_and_click(submit_button) |
1266 | |
1267 | self.assertTrue( |
1268 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1269 | @@ -347,26 +364,30 @@ |
1270 | def test_sim_pin_lock_control_lock_fail(self): |
1271 | self.modem_0.Set(SIM_IFACE, 'LockedPins', "") |
1272 | self._go_to_sim_lock() |
1273 | - sim_lock_control = self.system_settings.main_view.select_single( |
1274 | - objectName='simPinSwitch') |
1275 | + sim_lock_control = self.main_view.select_single( |
1276 | + objectName='simPinSwitch' |
1277 | + ) |
1278 | |
1279 | self.assertFalse( |
1280 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1281 | ) |
1282 | |
1283 | - self.system_settings.main_view.scroll_to_and_click(sim_lock_control) |
1284 | + self.main_view.scroll_to_and_click(sim_lock_control) |
1285 | |
1286 | - lock_dialog = self.system_settings.main_view.select_single( |
1287 | - objectName='lockDialogComponent') |
1288 | + lock_dialog = self.main_view.select_single( |
1289 | + objectName='lockDialogComponent' |
1290 | + ) |
1291 | self.assertEqual( |
1292 | lock_dialog.title, |
1293 | _("Enter SIM PIN") |
1294 | ) |
1295 | |
1296 | - prev_input = self.system_settings.main_view.select_single( |
1297 | - objectName='prevInput') |
1298 | - submit_button = self.system_settings.main_view.select_single( |
1299 | - objectName='lockButton') |
1300 | + prev_input = self.main_view.select_single( |
1301 | + objectName='prevInput' |
1302 | + ) |
1303 | + submit_button = self.main_view.select_single( |
1304 | + objectName='lockButton' |
1305 | + ) |
1306 | |
1307 | self.assertEqual( |
1308 | submit_button.text, |
1309 | @@ -376,14 +397,14 @@ |
1310 | self.assertFalse( |
1311 | submit_button.get_properties()['enabled'] |
1312 | ) |
1313 | - self.system_settings.main_view.scroll_to_and_click(prev_input) |
1314 | + self.main_view.scroll_to_and_click(prev_input) |
1315 | self.keyboard.type("1234") |
1316 | |
1317 | self.assertTrue( |
1318 | submit_button.get_properties()['enabled'] |
1319 | ) |
1320 | |
1321 | - self.system_settings.main_view.scroll_to_and_click(submit_button) |
1322 | + self.main_view.scroll_to_and_click(submit_button) |
1323 | |
1324 | self.assertFalse( |
1325 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1326 | |
1327 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_sound.py' |
1328 | --- tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2014-11-13 16:52:09 +0000 |
1329 | +++ tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2015-01-08 21:37:23 +0000 |
1330 | @@ -19,19 +19,20 @@ |
1331 | def test_sound_page(self): |
1332 | """ Checks whether Sound page is available """ |
1333 | self.assertThat( |
1334 | - self.system_settings.main_view.sound_page, |
1335 | + self.sound_page, |
1336 | NotEquals(None) |
1337 | ) |
1338 | self.assertThat( |
1339 | - self.system_settings.main_view.sound_page.title, |
1340 | + self.sound_page.title, |
1341 | Equals(_('Sound')) |
1342 | ) |
1343 | |
1344 | def test_silent_mode_sound_switch(self): |
1345 | """ Check that silent_mode is present and clickable""" |
1346 | - snd = self.system_settings.main_view.sound_page.select_single( |
1347 | - objectName="silentMode") |
1348 | - self.system_settings.main_view.scroll_to_and_click(snd) |
1349 | + snd = self.sound_page.select_single( |
1350 | + objectName="silentMode" |
1351 | + ) |
1352 | + self.main_view.scroll_to_and_click(snd) |
1353 | sleep(0.2) |
1354 | calls = self.dbus_mock_isound.GetCalls() |
1355 | self.assertThat( |
1356 | @@ -45,63 +46,56 @@ |
1357 | |
1358 | def test_call_vibrate_sound_switch(self): |
1359 | """ Check that call vibrate is present and clickable""" |
1360 | - snd = self.system_settings.main_view.sound_page.select_single( |
1361 | - objectName="callVibrate") |
1362 | - prev_value = self.obj_test.GetIncomingCallVibrate() |
1363 | - self.system_settings.main_view.scroll_to_and_click(snd) |
1364 | - sleep(0.2) |
1365 | - self.assertNotEqual( |
1366 | - self.obj_test.GetIncomingCallVibrate(), |
1367 | - prev_value) |
1368 | - |
1369 | - def test_call_vibrate_silent_mode_sound_switch(self): |
1370 | - """ Check that call vibrate silent mode is present and clickable""" |
1371 | - snd = self.system_settings.main_view.sound_page.select_single( |
1372 | - objectName="callVibrateSilentMode") |
1373 | - prev_value = self.obj_test.GetIncomingCallVibrateSilentMode() |
1374 | - self.system_settings.main_view.scroll_to_and_click(snd) |
1375 | - sleep(0.2) |
1376 | - self.assertNotEqual( |
1377 | - self.obj_test.GetIncomingCallVibrateSilentMode(), |
1378 | + snd = self.sound_page.select_single( |
1379 | + objectName="callVibrate" |
1380 | + ) |
1381 | + prev_value = self.obj_snd.GetIncomingCallVibrate() |
1382 | + self.main_view.scroll_to_and_click(snd) |
1383 | + sleep(0.2) |
1384 | + self.assertNotEqual( |
1385 | + self.obj_snd.GetIncomingCallVibrate(), |
1386 | prev_value) |
1387 | |
1388 | def test_message_vibrate_sound_switch(self): |
1389 | """ Check that message vibrate is present and clickable""" |
1390 | - snd = self.system_settings.main_view.sound_page.select_single( |
1391 | - objectName="messageVibrate") |
1392 | - prev_value = self.obj_test.GetIncomingMessageVibrate() |
1393 | - self.system_settings.main_view.scroll_to_and_click(snd) |
1394 | + snd = self.sound_page.select_single( |
1395 | + objectName="messageVibrate" |
1396 | + ) |
1397 | + prev_value = self.obj_snd.GetIncomingMessageVibrate() |
1398 | + self.main_view.scroll_to_and_click(snd) |
1399 | sleep(0.2) |
1400 | self.assertNotEqual( |
1401 | - self.obj_test.GetIncomingMessageVibrate(), |
1402 | + self.obj_snd.GetIncomingMessageVibrate(), |
1403 | prev_value) |
1404 | |
1405 | def test_message_vibrate_silent_mode_sound_switch(self): |
1406 | """ Check that message vibrate silent mode is present and clickable""" |
1407 | - snd = self.system_settings.main_view.sound_page.select_single( |
1408 | - objectName="messageVibrateSilentMode") |
1409 | - prev_value = self.obj_test.GetIncomingMessageVibrateSilentMode() |
1410 | - self.system_settings.main_view.scroll_to_and_click(snd) |
1411 | + snd = self.sound_page.select_single( |
1412 | + objectName="messageVibrateSilentMode" |
1413 | + ) |
1414 | + prev_value = self.obj_snd.GetIncomingMessageVibrateSilentMode() |
1415 | + self.main_view.scroll_to_and_click(snd) |
1416 | sleep(0.2) |
1417 | self.assertNotEqual( |
1418 | - self.obj_test.GetIncomingMessageVibrateSilentMode(), |
1419 | + self.obj_snd.GetIncomingMessageVibrateSilentMode(), |
1420 | prev_value) |
1421 | |
1422 | def test_keyboard_sound_switch(self): |
1423 | """ Check that keyboard sound is present and clickable""" |
1424 | - kbd_snd = self.system_settings.main_view.sound_page.select_single( |
1425 | - objectName="keyboardSoundSwitch") |
1426 | + kbd_snd = self.sound_page.select_single( |
1427 | + objectName="keyboardSoundSwitch" |
1428 | + ) |
1429 | current_value = kbd_snd.get_properties()["checked"] |
1430 | - self.system_settings.main_view.scroll_to_and_click(kbd_snd) |
1431 | + self.main_view.scroll_to_and_click(kbd_snd) |
1432 | self.assertThat( |
1433 | kbd_snd.get_properties()["checked"], NotEquals(current_value)) |
1434 | |
1435 | def test_dialpad_sounds_switch(self): |
1436 | - """ Check that dialpad_sounds is present and clickable""" |
1437 | - snd = self.system_settings.main_view.sound_page.select_single( |
1438 | - objectName="dialpadSounds") |
1439 | - prev_value = self.obj_test.GetDialpadSoundsEnabled() |
1440 | - self.system_settings.main_view.scroll_to_and_click(snd) |
1441 | + snd = self.sound_page.select_single( |
1442 | + objectName="dialpadSounds" |
1443 | + ) |
1444 | + prev_value = self.obj_snd.GetDialpadSoundsEnabled() |
1445 | + self.main_view.scroll_to_and_click(snd) |
1446 | self.assertThat( |
1447 | - lambda: self.obj_test.GetDialpadSoundsEnabled(), |
1448 | + lambda: self.obj_snd.GetDialpadSoundsEnabled(), |
1449 | Eventually(NotEquals(prev_value))) |
1450 | |
1451 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_wifi.py' |
1452 | --- tests/autopilot/ubuntu_system_settings/tests/test_wifi.py 2014-10-21 15:26:59 +0000 |
1453 | +++ tests/autopilot/ubuntu_system_settings/tests/test_wifi.py 2015-01-08 21:37:23 +0000 |
1454 | @@ -32,7 +32,7 @@ |
1455 | self.wifi_page.enable_wireless() |
1456 | dialog = self.wifi_page.connect_to_hidden_network( |
1457 | 'yeah', |
1458 | - scroll_to_and_click=self.system_settings.main_view |
1459 | + scroll_to_and_click=self.main_view |
1460 | .scroll_to_and_click) |
1461 | |
1462 | # allow backend to set up listeners |
1463 | @@ -59,7 +59,7 @@ |
1464 | self.wifi_page.enable_wireless() |
1465 | dialog = self.wifi_page.connect_to_hidden_network( |
1466 | 'yeah', |
1467 | - scroll_to_and_click=self.system_settings.main_view |
1468 | + scroll_to_and_click=self.main_view |
1469 | .scroll_to_and_click) |
1470 | |
1471 | # allow backend to set up listeners |
1472 | @@ -88,7 +88,7 @@ |
1473 | self.wifi_page.enable_wireless() |
1474 | dialog = self.wifi_page.connect_to_hidden_network( |
1475 | 'yeah', security='wpa', password='abcdefgh', |
1476 | - scroll_to_and_click=self.system_settings.main_view |
1477 | + scroll_to_and_click=self.main_view |
1478 | .scroll_to_and_click) |
1479 | |
1480 | # allow backend to set up listeners |
1481 | @@ -116,7 +116,7 @@ |
1482 | self.wifi_page.enable_wireless() |
1483 | dialog = self.wifi_page.connect_to_hidden_network( |
1484 | 'yeah', security='wpa', password='abcdefgh', |
1485 | - scroll_to_and_click=self.system_settings.main_view |
1486 | + scroll_to_and_click=self.main_view |
1487 | .scroll_to_and_click) |
1488 | # allow backend to set up listeners |
1489 | sleep(0.3) |
1490 | @@ -143,7 +143,7 @@ |
1491 | self.wifi_page.enable_wireless() |
1492 | dialog = self.wifi_page.connect_to_hidden_network( |
1493 | 'foo', |
1494 | - scroll_to_and_click=self.system_settings.main_view |
1495 | + scroll_to_and_click=self.main_view |
1496 | .scroll_to_and_click) |
1497 | |
1498 | # allow backend to set up listeners |
1499 | @@ -173,7 +173,7 @@ |
1500 | The NetworkManager dbusmock template does not currently support deletion |
1501 | of connections.""" |
1502 | def test_remove_previous_network(self): |
1503 | - click_method = self.system_settings.main_view.scroll_to_and_click |
1504 | + click_method = self.main_view.scroll_to_and_click |
1505 | previous_networks = [{ |
1506 | 'ssid': 'Series of Tubes', |
1507 | 'connection_name': 'conn_0' |
1508 | @@ -190,7 +190,7 @@ |
1509 | self.wifi_page.remove_previous_network( |
1510 | previous_networks[0]['ssid'], scroll_to_and_click=click_method) |
1511 | |
1512 | - self.system_settings.main_view.go_back() |
1513 | + self.main_view.go_back() |
1514 | |
1515 | # wait for ui to update |
1516 | sleep(2) |
<elopio> kenvandine: instead of having the pages as properties, I would make them methods.
<elopio> open_celular_page, for example.
<elopio> that way it's clearer when you read it that there's one user action involved.
<elopio> kenvandine: but your change it's clearly a step forward. Thanks.