Merge lp:~jonas-drange/ubuntu-system-settings/fix-autopilot-tests into lp:ubuntu-system-settings

Proposed by Jonas G. Drange
Status: Work in progress
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/fix-autopilot-tests
Merge into: lp:ubuntu-system-settings
Diff against target: 239 lines (+56/-40)
5 files modified
plugins/wifi/PageComponent.qml (+20/-26)
tests/autopilot/ubuntu_system_settings/tests/__init__.py (+13/-2)
tests/autopilot/ubuntu_system_settings/tests/test_about.py (+3/-7)
tests/autopilot/ubuntu_system_settings/tests/test_cellular.py (+10/-2)
tests/autopilot/ubuntu_system_settings/tests/test_wifi.py (+10/-3)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/fix-autopilot-tests
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
Ubuntu Touch System Settings Pending
Review via email: mp+306794@code.launchpad.net

Commit message

fixes some autopilot tests broken by various recent changes

To post a comment you must log in.
1723. By Jonas G. Drange

sync with trunk

1724. By Jonas G. Drange

fix broken test after rewrite

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1722
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~jonas-drange/ubuntu-system-settings/fix-autopilot-tests/+merge/306794/+edit-commit-message

https://jenkins.canonical.com/system-apps/job/lp-ubuntu-system-settings-ci/163/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1618/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1618
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1466/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1466
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1466/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1466/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1466
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1466/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1466
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1466/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1466
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1466/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1466
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1466/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1466/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1466
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1466/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-system-settings-ci/163/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1724
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~jonas-drange/ubuntu-system-settings/fix-autopilot-tests/+merge/306794/+edit-commit-message

https://jenkins.canonical.com/system-apps/job/lp-ubuntu-system-settings-ci/166/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1622
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/384
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1622
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1469/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1469
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1469/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-system-settings-ci/166/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1724
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-system-settings-ci/168/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1629/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1629
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1476
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1476/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1476/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1476/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1476
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1476/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1476
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1476/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1476
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1476/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1476
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1476/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1476/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1476
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1476/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-system-settings-ci/168/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

1724. By Jonas G. Drange

fix broken test after rewrite

1723. By Jonas G. Drange

sync with trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/wifi/PageComponent.qml'
2--- plugins/wifi/PageComponent.qml 2016-07-14 13:51:56 +0000
3+++ plugins/wifi/PageComponent.qml 2016-09-26 20:23:32 +0000
4@@ -19,6 +19,7 @@
5 import SystemSettings.ListItems 1.0 as SettingsListItems
6 import Ubuntu.Components 1.3
7 import Ubuntu.Components.Popups 1.3
8+import Ubuntu.Connectivity 1.0
9 import Ubuntu.SystemSettings.Wifi 1.0
10 import QMenuModel 0.1
11
12@@ -26,10 +27,21 @@
13 id: wifibase
14 objectName: "wifiPage"
15 title: i18n.tr("Wi-Fi")
16- property bool wifiEnabled: actionGroup.actionObject.valid ?
17- actionGroup.actionObject.state : false
18+
19 property var pluginOptions
20
21+ function invokeWiFiConfigurationDialog () {
22+ if (Connectivity.wifiEnabled && pluginOptions && pluginOptions['ssid']) {
23+ otherNetworLoader.source = "OtherNetwork.qml";
24+ PopupUtils.open(otherNetworLoader.item, wifibase, {
25+ 'ssid': pluginOptions['ssid'],
26+ 'bssid': pluginOptions['bssid']
27+ });
28+ }
29+ }
30+
31+ Component.onCompleted: invokeWiFiConfigurationDialog()
32+
33 UnityMenuModel {
34 id: menuModel
35 busName: "com.canonical.indicator.network"
36@@ -47,17 +59,6 @@
37 model: mainMenu.model
38 }
39
40- QDBusActionGroup {
41- id: actionGroup
42- busType: 1
43- busName: "com.canonical.indicator.network"
44- objectPath: "/com/canonical/indicator/network"
45- property variant actionObject: action("wifi.enable")
46- Component.onCompleted: {
47- start()
48- }
49- }
50-
51 Flickable {
52 id: pageFlickable
53 anchors.fill: parent
54@@ -126,7 +127,7 @@
55 SettingsListItems.Standard {
56 objectName: "connectToHiddenNetwork"
57 text: i18n.tr("Connect to hidden network…")
58- visible : wifibase.wifiEnabled
59+ visible : Connectivity.wifiEnabled
60 onClicked: {
61 otherNetworLoader.source = "OtherNetwork.qml";
62 PopupUtils.open(otherNetworLoader.item);
63@@ -153,18 +154,11 @@
64
65 Connections {
66 target: wifibase
67-
68- function invokeWiFiConfigurationDialog () {
69- if (wifiEnabled && pluginOptions && pluginOptions['ssid']) {
70- otherNetworLoader.source = "OtherNetwork.qml";
71- PopupUtils.open(otherNetworLoader.item, wifibase, {
72- 'ssid': pluginOptions['ssid'],
73- 'bssid': pluginOptions['bssid']
74- });
75- }
76- }
77-
78- onWifiEnabledChanged: invokeWiFiConfigurationDialog()
79 onPluginOptionsChanged: invokeWiFiConfigurationDialog()
80 }
81+
82+ Connections {
83+ target: Connectivity
84+ onWifiEnabledUpdated: invokeWiFiConfigurationDialog()
85+ }
86 }
87
88=== modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py'
89--- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2016-08-19 12:49:41 +0000
90+++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2016-09-26 20:23:32 +0000
91@@ -597,6 +597,8 @@
92 class HotspotBaseTestCase(UbuntuSystemSettingsHotspotTestCase):
93
94 def setUp(self):
95+ self.useFixture(EnvironmentVariable(
96+ 'USS_SHOW_ALL_UI', '1'))
97 super(HotspotBaseTestCase, self).setUp()
98 self.hotspot_page = self.main_view.go_to_hotspot_page()
99
100@@ -612,6 +614,8 @@
101 class PhoneOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase):
102 def setUp(self):
103 """ Go to Phone page """
104+ self.useFixture(EnvironmentVariable(
105+ 'USS_SHOW_ALL_UI', '1'))
106 super(PhoneOfonoBaseTestCase, self).setUp()
107 self.phone_page = self.main_view.go_to_phone_page()
108
109@@ -786,8 +790,8 @@
110 """Mock account service dbus, go to background page"""
111
112 # mock ubuntu art directory using a local path
113- art_dir = '%s/../background_images/' % (
114- os.path.dirname(os.path.realpath(__file__)))
115+ art_dir = '%s/background_images/' % (
116+ os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
117 user_obj = '/user/foo'
118
119 self.user_props = {
120@@ -1183,6 +1187,11 @@
121 inetwork, parameters=self.indicatornetwork_parameters,
122 stdout=subprocess.PIPE)
123
124+ ctv_tmpl = os.path.join(os.path.dirname(__file__), 'connectivity.py')
125+ (self.ctv_mock, self.obj_ctv) = self.spawn_server_template(
126+ ctv_tmpl, parameters=self.connectivity_parameters,
127+ stdout=subprocess.PIPE)
128+
129 self.obj_nm.Reset()
130
131 # Add a mock NetworkManager environment so we get consistent results
132@@ -1211,6 +1220,8 @@
133 self.main_view.scroll_to_and_click
134
135 def tearDown(self):
136+ self.ctv_mock.terminate()
137+ self.ctv_mock.wait()
138 self.inetwork_mock.terminate()
139 self.inetwork_mock.wait()
140 super(WifiBaseTestCase, self).tearDown()
141
142=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_about.py'
143--- tests/autopilot/ubuntu_system_settings/tests/test_about.py 2015-10-26 13:03:03 +0000
144+++ tests/autopilot/ubuntu_system_settings/tests/test_about.py 2016-09-26 20:23:32 +0000
145@@ -139,15 +139,11 @@
146 bus = self.get_dbus(system_bus=True)
147 service = bus.get_object('com.canonical.SystemImage', '/Service')
148 iface = dbus.Interface(service, 'com.canonical.SystemImage')
149- return iface.Info()
150+ return iface.Information()
151
152 def _get_last_updated_date(self):
153- info = self._get_system_image_iface()[3]
154-
155- if info == 'Unknown':
156- return _('Never')
157- else:
158- return dateutil.parser.parse(info.split()[0]).date()
159+ info = self._get_system_image_iface()
160+ return dateutil.parser.parse(info['last_update_date']).date()
161
162 def test_last_updated(self):
163 """Checks whether Last Updated info is correct."""
164
165=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_cellular.py'
166--- tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2016-08-16 16:10:06 +0000
167+++ tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2016-09-26 20:23:32 +0000
168@@ -10,6 +10,7 @@
169
170 from autopilot.introspection.dbus import StateNotFoundError
171 from autopilot.matchers import Eventually
172+from fixtures import EnvironmentVariable
173 from testtools.matchers import Equals, raises, StartsWith
174 from unittest import skip
175
176@@ -274,9 +275,12 @@
177 # click ask
178 self.system_settings.main_view.scroll_to_and_click(
179 self.get_default_sim_for_calls_selector('ask'))
180+
181 # click first sim
182- self.system_settings.main_view.scroll_to_and_click(
183- self.get_default_sim_for_calls_selector('/ril_0'))
184+ obj = self.get_default_sim_for_calls_selector('/ril_0')
185+ self.system_settings.main_view.scroll_to(obj)
186+ sleep(0.3)
187+ self.system_settings.main_view.pointing_device.click_object(obj)
188
189 self.assertThat(
190 lambda: self.obj_phone.GetDefaultSimForCalls(),
191@@ -297,6 +301,10 @@
192
193 class ApnTestCase(CellularBaseTestCase):
194
195+ def setUp(self):
196+ super(ApnTestCase, self).setUp()
197+ self.useFixture(EnvironmentVariable("UITK_USE_MALIIT", "1"))
198+
199 @skip('Skip until we can get the CPO for ListItem trigger actions')
200 def test_remove_apn(self):
201 self.add_connection_context(self.modem_0, Type='mms', Name='Failed')
202
203=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_wifi.py'
204--- tests/autopilot/ubuntu_system_settings/tests/test_wifi.py 2016-08-19 12:49:33 +0000
205+++ tests/autopilot/ubuntu_system_settings/tests/test_wifi.py 2016-09-26 20:23:32 +0000
206@@ -20,6 +20,10 @@
207 class WifiEnabledTestCase(WifiBaseTestCase):
208 """Tests for Language Page"""
209
210+ connectivity_parameters = {
211+ 'WifiEnabled': True,
212+ }
213+
214 def test_wifi_page_title_is_correct(self):
215 """Checks whether Wifi page is available"""
216 self.assertThat(
217@@ -52,9 +56,9 @@
218
219 class WifiDisabledTestCase(WifiBaseTestCase):
220
221- indicatornetwork_parameters = {'actions': {
222- 'wifi.enable': (False, '', [False]),
223- }}
224+ connectivity_parameters = {
225+ 'WifiEnabled': False,
226+ }
227
228 def test_connect_to_hidden_network_dialog_visibility(self):
229 self.assertThat(
230@@ -67,6 +71,9 @@
231 class WifiWithTestSSIDTestCase(WifiWithSSIDBaseTestCase):
232
233 ssid = 'test_ap'
234+ connectivity_parameters = {
235+ 'WifiEnabled': True,
236+ }
237
238 def test_handle_wifi_url_with_ssid(self):
239 dialog = self.main_view.wait_select_single(

Subscribers

People subscribed via source and target branches