Merge lp:~mars/launchpad/update-lazr-js-to-1.0 into lp:launchpad

Proposed by Māris Fogels
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: 11240
Proposed branch: lp:~mars/launchpad/update-lazr-js-to-1.0
Merge into: lp:launchpad
Diff against target: 269 lines (+37/-31)
15 files modified
.testr.conf (+1/-1)
lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html (+4/-4)
lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js (+1/-1)
lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html (+4/-4)
lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js (+1/-1)
lib/canonical/launchpad/windmill/testing/widgets.py (+4/-4)
lib/lp/app/javascript/tests/test_lp_collapsibles.html (+4/-4)
lib/lp/app/javascript/tests/test_lp_collapsibles.js (+1/-1)
lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py (+3/-3)
lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py (+1/-1)
lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py (+1/-1)
lib/lp/bugs/windmill/tests/test_mark_duplicate.py (+1/-1)
lib/lp/code/windmill/tests/test_branch_popupdiff.py (+3/-3)
lib/lp/registry/windmill/tests/test_person_picker.py (+7/-1)
versions.cfg (+1/-1)
To merge this branch: bzr merge lp:~mars/launchpad/update-lazr-js-to-1.0
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+30972@code.launchpad.net

Commit message

Update lazr-js to 1.0beta2, make testr use Xvfb by default.

Description of the change

Hi,

This branch updates Launchpad's version of LAZR-js to 1.0beta2. 1.0 includes an all-CSS version of many Launchpad widgets and some build system changes, so I updated our JavaScript build paths and test suite to accommodate this. The windmill suite caught all of these changes.

There is some refactoring that can be done in a later branch to wrap more of the XPATH statements into proper test objects.

Finally I included a change to the Test Resources config file so that the suite is run headless by default. It is risky to add complexity to the test infrastructure, but it is annoying to get spammed with Firefox windows when you use testr. I think the change adds more than it hurts.

Maris

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.testr.conf'
2--- .testr.conf 2010-03-03 13:47:52 +0000
3+++ .testr.conf 2010-07-27 23:12:48 +0000
4@@ -1,3 +1,3 @@
5 [DEFAULT]
6-test_command=./bin/test --subunit $IDOPTION
7+test_command=xvfb-run ./bin/test --subunit $IDOPTION
8 test_id_option=--load-list $IDFILE
9
10=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html'
11--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html 2009-09-29 09:28:33 +0000
12+++ lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html 2010-07-27 23:12:48 +0000
13@@ -4,10 +4,10 @@
14 <title>Launchpad ArchiveSubscriberIndex</title>
15
16 <!-- YUI 3.0 Setup -->
17- <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>
18- <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>
19- <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>
20- <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>
21+ <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
22+ <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
23+ <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
24+ <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
25 <link rel="stylesheet" href="../../test.css" />
26
27 <!-- The module under test -->
28
29=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js'
30--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2009-11-26 14:34:27 +0000
31+++ lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2010-07-27 23:12:48 +0000
32@@ -2,7 +2,7 @@
33 GNU Affero General Public License version 3 (see the file LICENSE). */
34
35 YUI({
36- base: '../../../icing/yui/current/build/',
37+ base: '../../../icing/yui/',
38 filter: 'raw',
39 combine: false
40 }).use(
41
42=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html'
43--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html 2009-07-01 13:16:44 +0000
44+++ lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html 2010-07-27 23:12:48 +0000
45@@ -4,10 +4,10 @@
46 <title>Launchpad DynamicDomUpdater</title>
47
48 <!-- YUI 3.0 Setup -->
49- <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>
50- <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>
51- <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>
52- <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>
53+ <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
54+ <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
55+ <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
56+ <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
57 <link rel="stylesheet" href="../../test.css" />
58
59 <!-- The module under test -->
60
61=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js'
62--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js 2009-11-26 14:34:27 +0000
63+++ lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js 2010-07-27 23:12:48 +0000
64@@ -2,7 +2,7 @@
65 GNU Affero General Public License version 3 (see the file LICENSE). */
66
67 YUI({
68- base: '../../../icing/yui/current/build/',
69+ base: '../../../icing/yui/',
70 filter: 'raw',
71 combine: false
72 }).use('test', 'console', 'soyuz.dynamic_dom_updater', function(Y) {
73
74=== modified file 'lib/canonical/launchpad/windmill/testing/widgets.py'
75--- lib/canonical/launchpad/windmill/testing/widgets.py 2010-07-08 21:07:32 +0000
76+++ lib/canonical/launchpad/windmill/testing/widgets.py 2010-07-27 23:12:48 +0000
77@@ -94,7 +94,7 @@
78
79 def search_picker_widget(client, search_text):
80 """Search in picker widget."""
81- search_box_xpath = (u"//table[contains(@class, 'yui-picker') "
82+ search_box_xpath = (u"//div[contains(@class, 'yui-picker ') "
83 "and not(contains(@class, 'yui-picker-hidden'))]"
84 "//input[@class='yui-picker-search']")
85 client.waits.forElement(
86@@ -102,7 +102,7 @@
87 timeout=constants.PAGE_LOAD)
88 client.type(text=search_text, xpath=search_box_xpath)
89 client.click(
90- xpath=u"//table[contains(@class, 'yui-picker') "
91+ xpath=u"//div[contains(@class, 'yui-picker ') "
92 "and not(contains(@class, 'yui-picker-hidden'))]"
93 "//div[@class='yui-picker-search-box']/button")
94
95@@ -110,7 +110,7 @@
96 """Search in picker widget and select item."""
97 search_picker_widget(client, search_text)
98 # Select item at the result_index in the list.
99- item_xpath = (u"//table[contains(@class, 'yui-picker') "
100+ item_xpath = (u"//div[contains(@class, 'yui-picker ') "
101 "and not(contains(@class, 'yui-picker-hidden'))]"
102 "//ul[@class='yui-picker-results']/li[%d]/span"
103 % result_index)
104@@ -235,7 +235,7 @@
105
106 # Click on remove button.
107 remove_button_xpath = (
108- u"//table[contains(@class, 'yui-picker') "
109+ u"//div[contains(@class, 'yui-picker ') "
110 "and not(contains(@class, 'yui-picker-hidden'))]"
111 "//*[contains(@class, '%s')]" % self.button_class)
112 client.waits.forElement(xpath=remove_button_xpath, timeout=u'25000')
113
114=== modified file 'lib/lp/app/javascript/tests/test_lp_collapsibles.html'
115--- lib/lp/app/javascript/tests/test_lp_collapsibles.html 2009-07-03 16:29:28 +0000
116+++ lib/lp/app/javascript/tests/test_lp_collapsibles.html 2010-07-27 23:12:48 +0000
117@@ -4,10 +4,10 @@
118 <title>Launchpad Collapsibles</title>
119
120 <!-- YUI 3.0 Setup -->
121- <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>
122- <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>
123- <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>
124- <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>
125+ <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
126+ <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
127+ <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
128+ <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
129 <link rel="stylesheet" href="../../test.css" />
130
131 <!-- The module under test -->
132
133=== modified file 'lib/lp/app/javascript/tests/test_lp_collapsibles.js'
134--- lib/lp/app/javascript/tests/test_lp_collapsibles.js 2009-11-25 19:21:59 +0000
135+++ lib/lp/app/javascript/tests/test_lp_collapsibles.js 2010-07-27 23:12:48 +0000
136@@ -1,7 +1,7 @@
137 /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
138
139 YUI({
140- base: '../../../icing/yui/current/build/',
141+ base: '../../../icing/yui/',
142 filter: 'raw',
143 combine: false
144 }).use('test', 'console', 'lp', function(Y) {
145
146=== modified file 'lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py'
147--- lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-04-12 13:17:16 +0000
148+++ lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-07-27 23:12:48 +0000
149@@ -87,16 +87,16 @@
150 name=u'search', timeout=FOR_ELEMENT)
151 client.type(
152 text=u'ubuntu-team',
153- xpath=u'//table[contains(@class, "yui-picker") '
154+ xpath=u'//div[contains(@class, "yui-picker ") '
155 'and not(contains(@class, "yui-picker-hidden"))]'
156 '//div[@class="yui-picker-search-box"]'
157 '/input[@name="search"]')
158 client.click(
159- xpath=u'//table[contains(@class, "yui-picker") '
160+ xpath=u'//div[contains(@class, "yui-picker ") '
161 'and not(contains(@class, "yui-picker-hidden"))]'
162 '//div[@class="yui-picker-search-box"]/button')
163 search_result_xpath = (
164- u'//table[contains(@class, "yui-picker") '
165+ u'//div[contains(@class, "yui-picker ") '
166 'and not(contains(@class, "yui-picker-hidden"))]'
167 '//ul[@class="yui-picker-results"]/li[1]/span')
168 client.waits.forElement(
169
170=== modified file 'lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py'
171--- lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-03-03 19:43:11 +0000
172+++ lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-07-27 23:12:48 +0000
173@@ -8,7 +8,7 @@
174 from lp.testing import WindmillTestCase
175
176 BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/15'
177-MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/table'
178+MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/div'
179 FORM_NOT_VISIBLE = (
180 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
181 FORM_VISIBLE = (
182
183=== modified file 'lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py'
184--- lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-02-04 19:22:37 +0000
185+++ lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-07-27 23:12:48 +0000
186@@ -9,7 +9,7 @@
187
188 FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
189
190-FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'
191+FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/div'
192 FORM_OVERLAY_CANCEL = (
193 u'//div[@id="duplicate-overlay-bug-4"]'
194 '//button[@name="field.actions.cancel"]')
195
196=== modified file 'lib/lp/bugs/windmill/tests/test_mark_duplicate.py'
197--- lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-07-22 16:27:12 +0000
198+++ lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-07-27 23:12:48 +0000
199@@ -12,7 +12,7 @@
200 from lp.bugs.windmill.testing import BugsWindmillLayer
201 from lp.testing import WindmillTestCase
202
203-MAIN_FORM_ELEMENT = u'//div[@id="duplicate-form-container"]/table'
204+MAIN_FORM_ELEMENT = u'//div[@id="duplicate-form-container"]/div'
205 FORM_NOT_VISIBLE = (
206 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
207 FORM_VISIBLE = (
208
209=== modified file 'lib/lp/code/windmill/tests/test_branch_popupdiff.py'
210--- lib/lp/code/windmill/tests/test_branch_popupdiff.py 2010-03-30 09:56:10 +0000
211+++ lib/lp/code/windmill/tests/test_branch_popupdiff.py 2010-07-27 23:12:48 +0000
212@@ -24,15 +24,15 @@
213 u'//dd[contains(@class, "popup-diff")]'
214 '/a[contains(@class, "js-action")]')
215 VISIBLE_DIFF = (
216- u'//table[contains(@class, "yui-diff-overlay") and '
217+ u'//div[contains(@class, "yui-diff-overlay ") and '
218 'not(contains(@class, "yui-diff-overlay-hidden"))]')
219 CLOSE_VISIBLE_DIFF = (
220- u'//table[contains(@class, "yui-diff-overlay")]'
221+ u'//div[contains(@class, "yui-diff-overlay ")]'
222 '//a[@class="close-button"]')
223 JS_ONLOAD_EXECUTE_DELAY = 2000
224 ADD_BRANCH_MENU = u'//a[contains(@class, "menu-link-addbranch")]'
225 VISIBLE_PICKER_OVERLAY = (
226- u'//table[contains(@class, "yui-picker") and '
227+ u'//div[contains(@class, "yui-picker ") and '
228 'not(contains(@class, "yui-picker-hidden"))]')
229 BRANCH_SEARCH_FIELD = VISIBLE_PICKER_OVERLAY + u'//input[@name="search"]'
230 BRANCH_SEARCH_BUTTON = (
231
232=== modified file 'lib/lp/registry/windmill/tests/test_person_picker.py'
233--- lib/lp/registry/windmill/tests/test_person_picker.py 2010-02-01 18:37:00 +0000
234+++ lib/lp/registry/windmill/tests/test_person_picker.py 2010-07-27 23:12:48 +0000
235@@ -14,6 +14,11 @@
236 from lp.testing import WindmillTestCase
237
238
239+VISIBLE_PICKER_OVERLAY = (
240+ u'//div[contains(@class, "yui-picker ") and '
241+ 'not(contains(@class, "yui-picker-hidden"))]')
242+
243+
244 class TesPersonPickerWidget(WindmillTestCase):
245
246 layer = RegistryWindmillLayer
247@@ -31,7 +36,8 @@
248 client.type(text=u'guilherme', name=u'field.dupe_person')
249
250 client.click(id=u'show-widget-field-dupe_person')
251- client.waits.forElement(id=u'shadow', timeout=constants.FOR_ELEMENT)
252+ client.waits.forElement(xpath=VISIBLE_PICKER_OVERLAY,
253+ timeout=constants.FOR_ELEMENT)
254
255 client.asserts.assertProperty(
256 xpath=u'//div[@class="yui-picker-search-box"]/input',
257
258=== modified file 'versions.cfg'
259--- versions.cfg 2010-07-23 08:50:49 +0000
260+++ versions.cfg 2010-07-27 23:12:48 +0000
261@@ -36,7 +36,7 @@
262 lazr.smtptest = 1.1
263 lazr.testing = 0.1.1
264 lazr.uri = 1.0.2
265-lazr-js = 0.9.2DEVr170
266+lazr-js = 1.0beta2
267 manuel = 1.1.1
268 martian = 0.11
269 mechanize = 0.1.11