Merge lp:~timo-jyrinki/ubuntu-html5-theme/autopilot_tests_offline into lp:~ubuntu-html5-theme-devs/ubuntu-html5-theme/ambiance

Proposed by Timo Jyrinki
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 63
Merged at revision: 62
Proposed branch: lp:~timo-jyrinki/ubuntu-html5-theme/autopilot_tests_offline
Merge into: lp:~ubuntu-html5-theme-devs/ubuntu-html5-theme/ambiance
Diff against target: 178 lines (+118/-8)
5 files modified
0.1/examples/apps/rss-reader/autopilot.html (+107/-0)
0.1/examples/apps/rss-reader/index.html (+1/-1)
debian/control (+1/-0)
tests/autopilot/ubuntu_html5_theme/tests/__init__.py (+2/-2)
tests/autopilot/ubuntu_html5_theme/tests/test_rss_reader.py (+7/-5)
To merge this branch: bzr merge lp:~timo-jyrinki/ubuntu-html5-theme/autopilot_tests_offline
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Didier Roche-Tolomelli (community) Approve
Review via email: mp+173439@code.launchpad.net

Commit message

Prepare the autopilot test to work with blocking firewall. Switch to using libjs-jquery instead of fetching from the web. Add autopilot.html without the Google dependency, disable one test for now that would need further contents mockup to work.

Description of the change

Prepare the autopilot test to work with blocking firewall. (LP: #1198820)

Switch to using libjs-jquery instead of fetching from the web. Add autopilot.html without the Google dependency, disable one test for now that would need further contents mockup to work.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

excellent work! that sounds good to me (and nice for the caching). The opened bug is fine :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '0.1/examples/apps/rss-reader/autopilot.html'
2--- 0.1/examples/apps/rss-reader/autopilot.html 1970-01-01 00:00:00 +0000
3+++ 0.1/examples/apps/rss-reader/autopilot.html 2013-07-08 07:59:31 +0000
4@@ -0,0 +1,107 @@
5+<!--
6+ Copyright (C) 2013 Adnane Belmadiaf <daker@ubuntu.com>
7+
8+ This file is part of ubuntu-html5-theme.
9+
10+ This package is free software; you can redistribute it and/or modify
11+ it under the terms of the Lesser GNU General Public License as
12+ published by the Free Software Foundation; either version 3 of the
13+ License, or
14+ (at your option) any later version.
15+
16+ This package is distributed in the hope that it will be useful,
17+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+ GNU General Public License for more details.
20+
21+ You should have received a copy of the GNU Lesser General Public
22+ License along with this program. If not, see
23+ <http://www.gnu.org/licenses/>.
24+-->
25+
26+<!DOCTYPE html>
27+<html>
28+<head>
29+ <meta charset="utf-8" />
30+ <meta name="copyright" content="Adnane Belmadiaf <daker@ubuntu.com>">
31+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
32+
33+ <title>RSS Mobile Reader - Ubuntu UI Example</title>
34+
35+ <!-- Ubuntu UI Style imports - Ambiance theme -->
36+ <link href="../../../ambiance/css/appTemplate.css" rel="stylesheet" type="text/css" />
37+
38+ <link href="styles.css" rel="stylesheet" type="text/css" />
39+
40+ <!-- External javascript imports -->
41+ <script src="file:///usr/share/javascript/jquery/jquery.min.js"></script>
42+
43+ <!-- Ubuntu UI javascript imports - Ambiance theme -->
44+ <script src="../../../ambiance/js/fast-buttons.js"></script>
45+ <script src="../../../ambiance/js/core.js"></script>
46+ <script src="../../../ambiance/js/buttons.js"></script>
47+ <script src="../../../ambiance/js/dialogs.js"></script>
48+ <script src="../../../ambiance/js/pagestacks.js"></script>
49+ <script src="../../../ambiance/js/popovers.js"></script>
50+
51+ <script src="app.js"></script>
52+</head>
53+
54+<body>
55+ <div data-role="page">
56+
57+ <header data-role="header">
58+ <nav data-role="navbar" class="tabs" >
59+ <div class="tabs-inner">
60+ <ul>
61+ <li class="active" role="tab">
62+ <a href="#item1" class="tab-item">RSS Mobile Reader</a>
63+ </li>
64+ </ul>
65+ </div>
66+ </nav>
67+ </header>
68+
69+ <div data-role="content">
70+ <div data-role="pagestack">
71+ <div data-role="page" id="main">
72+ <section data-role="list" id="yourfeeds"></section>
73+ <footer data-role="footer" class="revealed">
74+ <nav>
75+ <ul>
76+ <li>
77+ <a href="#" id="addfeed">
78+ <img src="../../../ambiance/img/back@18.png" alt="Tap me!" />
79+ <span>Add feed</span>
80+ </a>
81+ </li>
82+ </ul>
83+ </nav>
84+ </footer>
85+ </div>
86+
87+ <div data-role="page" id="results">
88+ <section data-role="list" id="resultscontent"></section>
89+ </div>
90+
91+ <div data-role="page" id="article">
92+ <section id="articleinfo"></section>
93+ </div>
94+ </div>
95+ <div data-role="dialog" id="addfeeddialog">
96+ <section>
97+ <h1>Add a new feed</h1>
98+ <p>Type the url feed you want to add</p>
99+ <input type="url" id="rssFeed" placeholder="http://">
100+ <menu>
101+ <button data-role="button" id="no">Cancel</button>
102+ <button data-role="button" class="success" id="yes">Add</button>
103+ </menu>
104+ </section>
105+ </div>
106+ <div data-role="dialog" id="loading"><section><progress></progress></section></div>
107+ </div>
108+
109+ </div>
110+</body>
111+</html>
112
113=== modified file '0.1/examples/apps/rss-reader/index.html'
114--- 0.1/examples/apps/rss-reader/index.html 2013-07-03 15:29:36 +0000
115+++ 0.1/examples/apps/rss-reader/index.html 2013-07-08 07:59:31 +0000
116@@ -35,7 +35,7 @@
117
118 <!-- External javascript imports -->
119 <script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAuvAXPRXL9qkzO0R8vzYpOhQ_BAnb8hQeSCQ2aBH79hHa1YbW_RQNN9ClKXG21xQObiXJ7diAAYaywg"></script>
120- <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
121+ <script src="file:///usr/share/javascript/jquery/jquery.min.js"></script>
122
123 <!-- Ubuntu UI javascript imports - Ambiance theme -->
124 <script src="../../../ambiance/js/fast-buttons.js"></script>
125
126=== modified file 'debian/control'
127--- debian/control 2013-07-08 06:39:09 +0000
128+++ debian/control 2013-07-08 07:59:31 +0000
129@@ -33,6 +33,7 @@
130 ${python:Depends},
131 dpkg-dev,
132 libautopilot-qt,
133+ libjs-jquery,
134 libqt5test5,
135 libqt5webkit5-qmlwebkitplugin,
136 qmlscene,
137
138=== modified file 'tests/autopilot/ubuntu_html5_theme/tests/__init__.py'
139--- tests/autopilot/ubuntu_html5_theme/tests/__init__.py 2013-07-07 16:13:52 +0000
140+++ tests/autopilot/ubuntu_html5_theme/tests/__init__.py 2013-07-08 07:59:31 +0000
141@@ -28,7 +28,7 @@
142
143 def get_served_filename(self, appname, filename):
144 if len(filename) == 0 or filename == '/':
145- filename = 'index.html'
146+ filename = 'autopilot.html'
147 print os.path.join(self.BASE_PATH_FOR_SERVED_APPS[appname], filename)
148 return os.path.join(self.BASE_PATH_FOR_SERVED_APPS[appname], filename)
149
150@@ -179,7 +179,7 @@
151 self.assert_url_eventually_loaded(url);
152
153 def browse_to_app(self, appname):
154- self.browse_to_url(self.create_file_url_from(self.BASE_PATH + '/' + self.APPS_SUBFOLDER_NAME + '/' + appname + '/index.html'))
155+ self.browse_to_url(self.create_file_url_from(self.BASE_PATH + '/' + self.APPS_SUBFOLDER_NAME + '/' + appname + '/autopilot.html'))
156
157 def browse_to_test_html(self, html_filename):
158 self.browse_to_url(self.create_file_url_from(os.path.abspath(self.BASE_PATH + '/../../tests/data/html/' + html_filename)))
159
160=== modified file 'tests/autopilot/ubuntu_html5_theme/tests/test_rss_reader.py'
161--- tests/autopilot/ubuntu_html5_theme/tests/test_rss_reader.py 2013-07-03 13:57:41 +0000
162+++ tests/autopilot/ubuntu_html5_theme/tests/test_rss_reader.py 2013-07-08 07:59:31 +0000
163@@ -27,11 +27,13 @@
164 self.assertThat(self.is_dom_node_visible('article'), Equals(False))
165 self.assertThat(self.is_dom_node_visible('results'), Equals(False))
166
167- def test_switchToFeedView(self):
168- self.click_any_dom_node_by_selector('#yourfeeds li a')
169- self.assertThat(lambda: self.is_dom_node_visible('main'), Eventually(Equals(False)))
170- self.assertThat(self.is_dom_node_visible('article'), Equals(False))
171- self.assertThat(self.is_dom_node_visible('results'), Equals(True))
172+# Needs further mockup for autopilot.html to work offline
173+# LP: https://bugs.launchpad.net/ubuntu-html5-theme/+bug/1198820
174+# def test_switchToFeedView(self):
175+# self.click_any_dom_node_by_selector('#yourfeeds li a')
176+# self.assertThat(lambda: self.is_dom_node_visible('main'), Eventually(Equals(False)))
177+# self.assertThat(self.is_dom_node_visible('article'), Equals(False))
178+# self.assertThat(self.is_dom_node_visible('results'), Equals(True))
179
180
181

Subscribers

People subscribed via source and target branches