Merge lp:~vrruiz/cordova-ubuntu-tests/enable-fix-persistent-path into lp:cordova-ubuntu-tests

Proposed by Víctor R. Ruiz
Status: Merged
Approved by: Víctor R. Ruiz
Approved revision: 33
Merged at revision: 34
Proposed branch: lp:~vrruiz/cordova-ubuntu-tests/enable-fix-persistent-path
Merge into: lp:cordova-ubuntu-tests
Diff against target: 129 lines (+15/-18)
2 files modified
tests/autopilot/cordova_ubuntu/tests/__init__.py (+13/-4)
tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py (+2/-14)
To merge this branch: bzr merge lp:~vrruiz/cordova-ubuntu-tests/enable-fix-persistent-path
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve
PS Jenkins bot continuous-integration Approve
Leo Arias Pending
Javier Collado Pending
Review via email: mp+203799@code.launchpad.net

Description of the change

This re-enables the skipped tests and fixes the problem with Cordova's local storage persistent path encoding.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

Ran the tests, looks good.

review: Approve
Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Thanks, Robert.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/cordova_ubuntu/tests/__init__.py'
2--- tests/autopilot/cordova_ubuntu/tests/__init__.py 2013-11-13 20:02:53 +0000
3+++ tests/autopilot/cordova_ubuntu/tests/__init__.py 2014-01-29 17:32:18 +0000
4@@ -12,6 +12,7 @@
5 import subprocess
6
7 from xml.dom import minidom
8+from base64 import b64encode
9 from testtools.matchers import Contains, Equals
10
11 from autopilot.input import Mouse, Touch, Pointer
12@@ -24,7 +25,10 @@
13 pointer = Pointer(Touch.create())
14 LOCAL_CORDOVA_CONTAINER_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),
15 '../../tools/qml/main-local.qml'))
16+ LOCAL_CORDOVA_APP_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),
17+ '../../../../www/'))
18 INSTALLED_CORDOVA_CONTAINER_PATH = '/usr/share/cordova-ubuntu-tests/autopilot-tests/qml/main.qml'
19+ INSTALLED_CORDOVA_APP_PATH = '/usr/share/cordova-ubuntu-tests/www/'
20 arch = subprocess.check_output(["dpkg-architecture",
21 "-qDEB_HOST_MULTIARCH"]).strip()
22 QML_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene"
23@@ -38,9 +42,14 @@
24 return self.INSTALLED_CORDOVA_CONTAINER_PATH
25
26 def get_persistent_path(self):
27+ """ Cordova Ubuntu hashes the persistent path """
28+ path = os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent', b64encode(self.get_cordova_app_path()))
29+ return path
30+
31+ def get_cordova_app_path(self):
32 if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):
33- return self.LOCAL_PERSISTENT_PATH
34- return self.PERSISTENT_PATH
35+ return self.LOCAL_CORDOVA_APP_PATH
36+ return self.INSTALLED_CORDOVA_APP_PATH
37
38 def setUp(self):
39 params = [self.QML_LAUNCHER, self.get_cordova_container_path()]
40@@ -49,7 +58,6 @@
41 self.app = self.launch_test_application(
42 *params,
43 app_type='qt')
44- print(params)
45 super(CordovaUbuntuTestCase, self).setUp()
46
47 def tearDown(self):
48@@ -87,4 +95,5 @@
49 testsuites = xml.getElementsByTagName('testsuite')
50 for testsuite in testsuites:
51 failures = testsuite.attributes['failures']
52- self.assertThat(failures.value, Equals('0'))
53+ self.assertThat(failures.nodeValue, Equals('0'))
54+
55
56=== modified file 'tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py'
57--- tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2013-11-06 19:29:56 +0000
58+++ tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2014-01-29 17:32:18 +0000
59@@ -53,34 +53,28 @@
60 # Process still running, sleep a bit
61 signal.alarm(0)
62 finished = True
63- if (junitxml_file):
64- self.assert_junitxml_failures(junitxml_file)
65+ if (junitxml_file):
66+ self.assert_junitxml_failures(junitxml_file)
67 except Alarm:
68 # Timeout reached
69 pass
70 self.assertThat(finished, Equals(True))
71
72- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
73 def test_accelerometer(self):
74 self.run_mobilespec('accelerometer', 'TEST-Accelerometernavigatoraccelerometer.xml')
75
76- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
77 def test_battery(self):
78 self.run_mobilespec('battery', 'TEST-Batterynavigatorbattery.xml')
79
80- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
81 def test_camera(self):
82 self.run_mobilespec('camera', 'TEST-CameraConstantswindowCameranavigatorcamera.xml')
83
84- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
85 def test_capture(self):
86 self.run_mobilespec('capture', 'TEST-Capturenavigatordevicecapture.xml')
87
88- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
89 def test_compass(self):
90 self.run_mobilespec('compass', 'TEST-Compassnavigatorcompass.xml')
91
92- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
93 def test_contacts(self):
94 self.run_mobilespec('contacts', 'TEST-Contactsnavigatorcontacts.xml')
95
96@@ -93,19 +87,15 @@
97 def test_file(self):
98 self.run_mobilespec('file', 'TEST-FileAPI.xml')
99
100- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
101 def test_filetransfer(self):
102 self.run_mobilespec('filetransfer', 'TEST-FileTransfer.xml')
103
104- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
105 def test_geolocation(self):
106 self.run_mobilespec('geolocation', 'TEST-Geolocationnavigatorgeolocation.xml')
107
108- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
109 def test_globalization(self):
110 self.run_mobilespec('globalization', 'TEST-Globalizationnavigatorglobalization.xml')
111
112- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
113 def test_media(self):
114 self.run_mobilespec('media', 'TEST-Media.xml')
115
116@@ -121,13 +111,11 @@
117 def test_storage(self):
118 self.run_mobilespec('storage', 'TEST-SessionStorage.xml')
119
120- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
121 def test_bridge(self):
122 self.run_mobilespec('bridge', 'TEST-bridge.xml')
123
124 def test_splashscreen(self):
125 self.run_mobilespec('splashscreen', 'TEST-Splashscreencordova.xml')
126
127- @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
128 def test_whitelist(self):
129 self.run_mobilespec('whitelist', 'TEST-whitelist.xml')

Subscribers

People subscribed via source and target branches