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
=== modified file '.testr.conf'
--- .testr.conf 2010-03-03 13:47:52 +0000
+++ .testr.conf 2010-07-27 23:12:48 +0000
@@ -1,3 +1,3 @@
1[DEFAULT]1[DEFAULT]
2test_command=./bin/test --subunit $IDOPTION2test_command=xvfb-run ./bin/test --subunit $IDOPTION
3test_id_option=--load-list $IDFILE3test_id_option=--load-list $IDFILE
44
=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html'
--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html 2009-09-29 09:28:33 +0000
+++ lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html 2010-07-27 23:12:48 +0000
@@ -4,10 +4,10 @@
4 <title>Launchpad ArchiveSubscriberIndex</title>4 <title>Launchpad ArchiveSubscriberIndex</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>10 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
11 <link rel="stylesheet" href="../../test.css" />11 <link rel="stylesheet" href="../../test.css" />
1212
13 <!-- The module under test -->13 <!-- The module under test -->
1414
=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js'
--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2009-11-26 14:34:27 +0000
+++ lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2010-07-27 23:12:48 +0000
@@ -2,7 +2,7 @@
2 GNU Affero General Public License version 3 (see the file LICENSE). */2 GNU Affero General Public License version 3 (see the file LICENSE). */
33
4YUI({4YUI({
5 base: '../../../icing/yui/current/build/',5 base: '../../../icing/yui/',
6 filter: 'raw',6 filter: 'raw',
7 combine: false7 combine: false
8 }).use(8 }).use(
99
=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html'
--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html 2009-07-01 13:16:44 +0000
+++ lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html 2010-07-27 23:12:48 +0000
@@ -4,10 +4,10 @@
4 <title>Launchpad DynamicDomUpdater</title>4 <title>Launchpad DynamicDomUpdater</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>10 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
11 <link rel="stylesheet" href="../../test.css" />11 <link rel="stylesheet" href="../../test.css" />
1212
13 <!-- The module under test -->13 <!-- The module under test -->
1414
=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js'
--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js 2009-11-26 14:34:27 +0000
+++ lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js 2010-07-27 23:12:48 +0000
@@ -2,7 +2,7 @@
2 GNU Affero General Public License version 3 (see the file LICENSE). */2 GNU Affero General Public License version 3 (see the file LICENSE). */
33
4YUI({4YUI({
5 base: '../../../icing/yui/current/build/',5 base: '../../../icing/yui/',
6 filter: 'raw',6 filter: 'raw',
7 combine: false7 combine: false
8 }).use('test', 'console', 'soyuz.dynamic_dom_updater', function(Y) {8 }).use('test', 'console', 'soyuz.dynamic_dom_updater', function(Y) {
99
=== modified file 'lib/canonical/launchpad/windmill/testing/widgets.py'
--- lib/canonical/launchpad/windmill/testing/widgets.py 2010-07-08 21:07:32 +0000
+++ lib/canonical/launchpad/windmill/testing/widgets.py 2010-07-27 23:12:48 +0000
@@ -94,7 +94,7 @@
9494
95def search_picker_widget(client, search_text):95def search_picker_widget(client, search_text):
96 """Search in picker widget."""96 """Search in picker widget."""
97 search_box_xpath = (u"//table[contains(@class, 'yui-picker') "97 search_box_xpath = (u"//div[contains(@class, 'yui-picker ') "
98 "and not(contains(@class, 'yui-picker-hidden'))]"98 "and not(contains(@class, 'yui-picker-hidden'))]"
99 "//input[@class='yui-picker-search']")99 "//input[@class='yui-picker-search']")
100 client.waits.forElement(100 client.waits.forElement(
@@ -102,7 +102,7 @@
102 timeout=constants.PAGE_LOAD)102 timeout=constants.PAGE_LOAD)
103 client.type(text=search_text, xpath=search_box_xpath)103 client.type(text=search_text, xpath=search_box_xpath)
104 client.click(104 client.click(
105 xpath=u"//table[contains(@class, 'yui-picker') "105 xpath=u"//div[contains(@class, 'yui-picker ') "
106 "and not(contains(@class, 'yui-picker-hidden'))]"106 "and not(contains(@class, 'yui-picker-hidden'))]"
107 "//div[@class='yui-picker-search-box']/button")107 "//div[@class='yui-picker-search-box']/button")
108108
@@ -110,7 +110,7 @@
110 """Search in picker widget and select item."""110 """Search in picker widget and select item."""
111 search_picker_widget(client, search_text)111 search_picker_widget(client, search_text)
112 # Select item at the result_index in the list.112 # Select item at the result_index in the list.
113 item_xpath = (u"//table[contains(@class, 'yui-picker') "113 item_xpath = (u"//div[contains(@class, 'yui-picker ') "
114 "and not(contains(@class, 'yui-picker-hidden'))]"114 "and not(contains(@class, 'yui-picker-hidden'))]"
115 "//ul[@class='yui-picker-results']/li[%d]/span"115 "//ul[@class='yui-picker-results']/li[%d]/span"
116 % result_index)116 % result_index)
@@ -235,7 +235,7 @@
235235
236 # Click on remove button.236 # Click on remove button.
237 remove_button_xpath = (237 remove_button_xpath = (
238 u"//table[contains(@class, 'yui-picker') "238 u"//div[contains(@class, 'yui-picker ') "
239 "and not(contains(@class, 'yui-picker-hidden'))]"239 "and not(contains(@class, 'yui-picker-hidden'))]"
240 "//*[contains(@class, '%s')]" % self.button_class)240 "//*[contains(@class, '%s')]" % self.button_class)
241 client.waits.forElement(xpath=remove_button_xpath, timeout=u'25000')241 client.waits.forElement(xpath=remove_button_xpath, timeout=u'25000')
242242
=== modified file 'lib/lp/app/javascript/tests/test_lp_collapsibles.html'
--- lib/lp/app/javascript/tests/test_lp_collapsibles.html 2009-07-03 16:29:28 +0000
+++ lib/lp/app/javascript/tests/test_lp_collapsibles.html 2010-07-27 23:12:48 +0000
@@ -4,10 +4,10 @@
4 <title>Launchpad Collapsibles</title>4 <title>Launchpad Collapsibles</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>10 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
11 <link rel="stylesheet" href="../../test.css" />11 <link rel="stylesheet" href="../../test.css" />
1212
13 <!-- The module under test -->13 <!-- The module under test -->
1414
=== modified file 'lib/lp/app/javascript/tests/test_lp_collapsibles.js'
--- lib/lp/app/javascript/tests/test_lp_collapsibles.js 2009-11-25 19:21:59 +0000
+++ lib/lp/app/javascript/tests/test_lp_collapsibles.js 2010-07-27 23:12:48 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../../icing/yui/current/build/',4 base: '../../../icing/yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('test', 'console', 'lp', function(Y) {7 }).use('test', 'console', 'lp', function(Y) {
88
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py'
--- lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-04-12 13:17:16 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-07-27 23:12:48 +0000
@@ -87,16 +87,16 @@
87 name=u'search', timeout=FOR_ELEMENT)87 name=u'search', timeout=FOR_ELEMENT)
88 client.type(88 client.type(
89 text=u'ubuntu-team',89 text=u'ubuntu-team',
90 xpath=u'//table[contains(@class, "yui-picker") '90 xpath=u'//div[contains(@class, "yui-picker ") '
91 'and not(contains(@class, "yui-picker-hidden"))]'91 'and not(contains(@class, "yui-picker-hidden"))]'
92 '//div[@class="yui-picker-search-box"]'92 '//div[@class="yui-picker-search-box"]'
93 '/input[@name="search"]')93 '/input[@name="search"]')
94 client.click(94 client.click(
95 xpath=u'//table[contains(@class, "yui-picker") '95 xpath=u'//div[contains(@class, "yui-picker ") '
96 'and not(contains(@class, "yui-picker-hidden"))]'96 'and not(contains(@class, "yui-picker-hidden"))]'
97 '//div[@class="yui-picker-search-box"]/button')97 '//div[@class="yui-picker-search-box"]/button')
98 search_result_xpath = (98 search_result_xpath = (
99 u'//table[contains(@class, "yui-picker") '99 u'//div[contains(@class, "yui-picker ") '
100 'and not(contains(@class, "yui-picker-hidden"))]'100 'and not(contains(@class, "yui-picker-hidden"))]'
101 '//ul[@class="yui-picker-results"]/li[1]/span')101 '//ul[@class="yui-picker-results"]/li[1]/span')
102 client.waits.forElement(102 client.waits.forElement(
103103
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py'
--- lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-03-03 19:43:11 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-07-27 23:12:48 +0000
@@ -8,7 +8,7 @@
8from lp.testing import WindmillTestCase8from lp.testing import WindmillTestCase
99
10BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/15'10BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/15'
11MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/table'11MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/div'
12FORM_NOT_VISIBLE = (12FORM_NOT_VISIBLE = (
13 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')13 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
14FORM_VISIBLE = (14FORM_VISIBLE = (
1515
=== modified file 'lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py'
--- lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-02-04 19:22:37 +0000
+++ lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-07-27 23:12:48 +0000
@@ -9,7 +9,7 @@
99
10FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'10FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
1111
12FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'12FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/div'
13FORM_OVERLAY_CANCEL = (13FORM_OVERLAY_CANCEL = (
14 u'//div[@id="duplicate-overlay-bug-4"]'14 u'//div[@id="duplicate-overlay-bug-4"]'
15 '//button[@name="field.actions.cancel"]')15 '//button[@name="field.actions.cancel"]')
1616
=== modified file 'lib/lp/bugs/windmill/tests/test_mark_duplicate.py'
--- lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-07-22 16:27:12 +0000
+++ lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-07-27 23:12:48 +0000
@@ -12,7 +12,7 @@
12from lp.bugs.windmill.testing import BugsWindmillLayer12from lp.bugs.windmill.testing import BugsWindmillLayer
13from lp.testing import WindmillTestCase13from lp.testing import WindmillTestCase
1414
15MAIN_FORM_ELEMENT = u'//div[@id="duplicate-form-container"]/table'15MAIN_FORM_ELEMENT = u'//div[@id="duplicate-form-container"]/div'
16FORM_NOT_VISIBLE = (16FORM_NOT_VISIBLE = (
17 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')17 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
18FORM_VISIBLE = (18FORM_VISIBLE = (
1919
=== modified file 'lib/lp/code/windmill/tests/test_branch_popupdiff.py'
--- lib/lp/code/windmill/tests/test_branch_popupdiff.py 2010-03-30 09:56:10 +0000
+++ lib/lp/code/windmill/tests/test_branch_popupdiff.py 2010-07-27 23:12:48 +0000
@@ -24,15 +24,15 @@
24 u'//dd[contains(@class, "popup-diff")]'24 u'//dd[contains(@class, "popup-diff")]'
25 '/a[contains(@class, "js-action")]')25 '/a[contains(@class, "js-action")]')
26VISIBLE_DIFF = (26VISIBLE_DIFF = (
27 u'//table[contains(@class, "yui-diff-overlay") and '27 u'//div[contains(@class, "yui-diff-overlay ") and '
28 'not(contains(@class, "yui-diff-overlay-hidden"))]')28 'not(contains(@class, "yui-diff-overlay-hidden"))]')
29CLOSE_VISIBLE_DIFF = (29CLOSE_VISIBLE_DIFF = (
30 u'//table[contains(@class, "yui-diff-overlay")]'30 u'//div[contains(@class, "yui-diff-overlay ")]'
31 '//a[@class="close-button"]')31 '//a[@class="close-button"]')
32JS_ONLOAD_EXECUTE_DELAY = 200032JS_ONLOAD_EXECUTE_DELAY = 2000
33ADD_BRANCH_MENU = u'//a[contains(@class, "menu-link-addbranch")]'33ADD_BRANCH_MENU = u'//a[contains(@class, "menu-link-addbranch")]'
34VISIBLE_PICKER_OVERLAY = (34VISIBLE_PICKER_OVERLAY = (
35 u'//table[contains(@class, "yui-picker") and '35 u'//div[contains(@class, "yui-picker ") and '
36 'not(contains(@class, "yui-picker-hidden"))]')36 'not(contains(@class, "yui-picker-hidden"))]')
37BRANCH_SEARCH_FIELD = VISIBLE_PICKER_OVERLAY + u'//input[@name="search"]'37BRANCH_SEARCH_FIELD = VISIBLE_PICKER_OVERLAY + u'//input[@name="search"]'
38BRANCH_SEARCH_BUTTON = (38BRANCH_SEARCH_BUTTON = (
3939
=== modified file 'lib/lp/registry/windmill/tests/test_person_picker.py'
--- lib/lp/registry/windmill/tests/test_person_picker.py 2010-02-01 18:37:00 +0000
+++ lib/lp/registry/windmill/tests/test_person_picker.py 2010-07-27 23:12:48 +0000
@@ -14,6 +14,11 @@
14from lp.testing import WindmillTestCase14from lp.testing import WindmillTestCase
1515
1616
17VISIBLE_PICKER_OVERLAY = (
18 u'//div[contains(@class, "yui-picker ") and '
19 'not(contains(@class, "yui-picker-hidden"))]')
20
21
17class TesPersonPickerWidget(WindmillTestCase):22class TesPersonPickerWidget(WindmillTestCase):
1823
19 layer = RegistryWindmillLayer24 layer = RegistryWindmillLayer
@@ -31,7 +36,8 @@
31 client.type(text=u'guilherme', name=u'field.dupe_person')36 client.type(text=u'guilherme', name=u'field.dupe_person')
3237
33 client.click(id=u'show-widget-field-dupe_person')38 client.click(id=u'show-widget-field-dupe_person')
34 client.waits.forElement(id=u'shadow', timeout=constants.FOR_ELEMENT)39 client.waits.forElement(xpath=VISIBLE_PICKER_OVERLAY,
40 timeout=constants.FOR_ELEMENT)
3541
36 client.asserts.assertProperty(42 client.asserts.assertProperty(
37 xpath=u'//div[@class="yui-picker-search-box"]/input',43 xpath=u'//div[@class="yui-picker-search-box"]/input',
3844
=== modified file 'versions.cfg'
--- versions.cfg 2010-07-23 08:50:49 +0000
+++ versions.cfg 2010-07-27 23:12:48 +0000
@@ -36,7 +36,7 @@
36lazr.smtptest = 1.136lazr.smtptest = 1.1
37lazr.testing = 0.1.137lazr.testing = 0.1.1
38lazr.uri = 1.0.238lazr.uri = 1.0.2
39lazr-js = 0.9.2DEVr17039lazr-js = 1.0beta2
40manuel = 1.1.140manuel = 1.1.1
41martian = 0.1141martian = 0.11
42mechanize = 0.1.1142mechanize = 0.1.11