← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Māris Fogels has proposed merging lp:~mars/launchpad/update-lazr-js-to-1.0 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


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
-- 
https://code.launchpad.net/~mars/launchpad/update-lazr-js-to-1.0/+merge/30972
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mars/launchpad/update-lazr-js-to-1.0 into lp:launchpad/devel.
=== modified file '.testr.conf'
--- .testr.conf	2010-03-03 13:47:52 +0000
+++ .testr.conf	2010-07-26 17:36:15 +0000
@@ -1,3 +1,3 @@
 [DEFAULT]
-test_command=./bin/test --subunit $IDOPTION
+test_command=xvfb-run ./bin/test --subunit $IDOPTION
 test_id_option=--load-list $IDFILE

=== 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-26 17:36:15 +0000
@@ -4,10 +4,10 @@
   <title>Launchpad ArchiveSubscriberIndex</title>
 
   <!-- YUI 3.0 Setup -->
-  <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>
+  <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
+  <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
+  <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
+  <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
   <link rel="stylesheet" href="../../test.css" />
 
   <!-- The module under test -->

=== 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-26 17:36:15 +0000
@@ -2,7 +2,7 @@
    GNU Affero General Public License version 3 (see the file LICENSE). */
 
 YUI({
-    base: '../../../icing/yui/current/build/',
+    base: '../../../icing/yui/',
     filter: 'raw',
     combine: false
     }).use(

=== 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-26 17:36:15 +0000
@@ -4,10 +4,10 @@
   <title>Launchpad DynamicDomUpdater</title>
 
   <!-- YUI 3.0 Setup -->
-  <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>
+  <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
+  <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
+  <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
+  <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
   <link rel="stylesheet" href="../../test.css" />
 
   <!-- The module under test -->

=== 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-26 17:36:15 +0000
@@ -2,7 +2,7 @@
    GNU Affero General Public License version 3 (see the file LICENSE). */
 
 YUI({
-    base: '../../../icing/yui/current/build/',
+    base: '../../../icing/yui/',
     filter: 'raw',
     combine: false
     }).use('test', 'console', 'soyuz.dynamic_dom_updater', function(Y) {

=== 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-26 17:36:15 +0000
@@ -94,7 +94,7 @@
 
 def search_picker_widget(client, search_text):
     """Search in picker widget."""
-    search_box_xpath = (u"//table[contains(@class, 'yui-picker') "
+    search_box_xpath = (u"//div[contains(@class, 'yui-picker ') "
                          "and not(contains(@class, 'yui-picker-hidden'))]"
                          "//input[@class='yui-picker-search']")
     client.waits.forElement(
@@ -102,7 +102,7 @@
         timeout=constants.PAGE_LOAD)
     client.type(text=search_text, xpath=search_box_xpath)
     client.click(
-        xpath=u"//table[contains(@class, 'yui-picker') "
+        xpath=u"//div[contains(@class, 'yui-picker ') "
                "and not(contains(@class, 'yui-picker-hidden'))]"
                "//div[@class='yui-picker-search-box']/button")
 
@@ -110,7 +110,7 @@
     """Search in picker widget and select item."""
     search_picker_widget(client, search_text)
     # Select item at the result_index in the list.
-    item_xpath = (u"//table[contains(@class, 'yui-picker') "
+    item_xpath = (u"//div[contains(@class, 'yui-picker ') "
                      "and not(contains(@class, 'yui-picker-hidden'))]"
                      "//ul[@class='yui-picker-results']/li[%d]/span"
                      % result_index)
@@ -235,7 +235,7 @@
 
         # Click on remove button.
         remove_button_xpath = (
-            u"//table[contains(@class, 'yui-picker') "
+            u"//div[contains(@class, 'yui-picker ') "
              "and not(contains(@class, 'yui-picker-hidden'))]"
              "//*[contains(@class, '%s')]" % self.button_class)
         client.waits.forElement(xpath=remove_button_xpath, timeout=u'25000')

=== 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-26 17:36:15 +0000
@@ -4,10 +4,10 @@
   <title>Launchpad Collapsibles</title>
 
   <!-- YUI 3.0 Setup -->
-  <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>
-  <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>
+  <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
+  <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
+  <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
+  <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
   <link rel="stylesheet" href="../../test.css" />
 
   <!-- The module under test -->

=== 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-26 17:36:15 +0000
@@ -1,7 +1,7 @@
 /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
 
 YUI({
-    base: '../../../icing/yui/current/build/',
+    base: '../../../icing/yui/',
     filter: 'raw',
     combine: false
     }).use('test', 'console', 'lp', function(Y) {

=== 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-26 17:36:15 +0000
@@ -87,16 +87,16 @@
             name=u'search', timeout=FOR_ELEMENT)
         client.type(
             text=u'ubuntu-team',
-            xpath=u'//table[contains(@class, "yui-picker") '
+            xpath=u'//div[contains(@class, "yui-picker ") '
                    'and not(contains(@class, "yui-picker-hidden"))]'
                    '//div[@class="yui-picker-search-box"]'
                    '/input[@name="search"]')
         client.click(
-            xpath=u'//table[contains(@class, "yui-picker") '
+            xpath=u'//div[contains(@class, "yui-picker ") '
                    'and not(contains(@class, "yui-picker-hidden"))]'
                    '//div[@class="yui-picker-search-box"]/button')
         search_result_xpath = (
-            u'//table[contains(@class, "yui-picker") '
+            u'//div[contains(@class, "yui-picker ") '
             'and not(contains(@class, "yui-picker-hidden"))]'
             '//ul[@class="yui-picker-results"]/li[1]/span')
         client.waits.forElement(

=== 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-26 17:36:15 +0000
@@ -8,7 +8,7 @@
 from lp.testing import WindmillTestCase
 
 BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/15'
-MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/table'
+MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/div'
 FORM_NOT_VISIBLE = (
     u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
 FORM_VISIBLE = (

=== 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-26 17:36:15 +0000
@@ -9,7 +9,7 @@
 
 FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
 
-FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'
+FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/div'
 FORM_OVERLAY_CANCEL = (
     u'//div[@id="duplicate-overlay-bug-4"]'
     '//button[@name="field.actions.cancel"]')

=== 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-26 17:36:15 +0000
@@ -12,7 +12,7 @@
 from lp.bugs.windmill.testing import BugsWindmillLayer
 from lp.testing import WindmillTestCase
 
-MAIN_FORM_ELEMENT = u'//div[@id="duplicate-form-container"]/table'
+MAIN_FORM_ELEMENT = u'//div[@id="duplicate-form-container"]/div'
 FORM_NOT_VISIBLE = (
     u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
 FORM_VISIBLE = (

=== 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-26 17:36:15 +0000
@@ -24,15 +24,15 @@
     u'//dd[contains(@class, "popup-diff")]'
     '/a[contains(@class, "js-action")]')
 VISIBLE_DIFF = (
-    u'//table[contains(@class, "yui-diff-overlay") and '
+    u'//div[contains(@class, "yui-diff-overlay ") and '
      'not(contains(@class, "yui-diff-overlay-hidden"))]')
 CLOSE_VISIBLE_DIFF = (
-    u'//table[contains(@class, "yui-diff-overlay")]'
+    u'//div[contains(@class, "yui-diff-overlay ")]'
      '//a[@class="close-button"]')
 JS_ONLOAD_EXECUTE_DELAY = 2000
 ADD_BRANCH_MENU = u'//a[contains(@class, "menu-link-addbranch")]'
 VISIBLE_PICKER_OVERLAY = (
-    u'//table[contains(@class, "yui-picker") and '
+    u'//div[contains(@class, "yui-picker ") and '
      'not(contains(@class, "yui-picker-hidden"))]')
 BRANCH_SEARCH_FIELD = VISIBLE_PICKER_OVERLAY + u'//input[@name="search"]'
 BRANCH_SEARCH_BUTTON = (

=== 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-26 17:36:15 +0000
@@ -14,6 +14,11 @@
 from lp.testing import WindmillTestCase
 
 
+VISIBLE_PICKER_OVERLAY = (
+    u'//div[contains(@class, "yui-picker ") and '
+     'not(contains(@class, "yui-picker-hidden"))]')
+
+
 class TesPersonPickerWidget(WindmillTestCase):
 
     layer = RegistryWindmillLayer
@@ -31,7 +36,8 @@
         client.type(text=u'guilherme', name=u'field.dupe_person')
 
         client.click(id=u'show-widget-field-dupe_person')
-        client.waits.forElement(id=u'shadow', timeout=constants.FOR_ELEMENT)
+        client.waits.forElement(xpath=VISIBLE_PICKER_OVERLAY,
+                                timeout=constants.FOR_ELEMENT)
 
         client.asserts.assertProperty(
             xpath=u'//div[@class="yui-picker-search-box"]/input',

=== modified file 'versions.cfg'
--- versions.cfg	2010-07-23 08:50:49 +0000
+++ versions.cfg	2010-07-26 17:36:15 +0000
@@ -36,7 +36,7 @@
 lazr.smtptest = 1.1
 lazr.testing = 0.1.1
 lazr.uri = 1.0.2
-lazr-js = 0.9.2DEVr170
+lazr-js = 1.0beta2
 manuel = 1.1.1
 martian = 0.11
 mechanize = 0.1.11