Bug 1014609 - Part 5: Remove jquery in accountProvisioner.js: fix corresponding mozmill test. r=mkmelin
authoraleth <aleth@instantbird.org>
Tue, 25 Aug 2015 19:48:17 +0200
changeset 18471 c5401915af893260262edddd66921570370fe3c3
parent 18470 32eb613ad2eb74dab38722910b4e4e2b08ee780e
child 18472 180bafc8f18cc4bae161fa14b192d356b9284bd8
push id11305
push useraleth@instantbird.org
push dateWed, 30 Sep 2015 21:06:54 +0000
treeherdercomm-central@180bafc8f18c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1014609
Bug 1014609 - Part 5: Remove jquery in accountProvisioner.js: fix corresponding mozmill test. r=mkmelin
mail/test/mozmill/newmailaccount/test-newmailaccount.js
--- a/mail/test/mozmill/newmailaccount/test-newmailaccount.js
+++ b/mail/test/mozmill/newmailaccount/test-newmailaccount.js
@@ -179,17 +179,17 @@ function subtest_get_an_account(w) {
   type_in_search_name(w, "Green Llama");
 
   w.click(w.eid("searchSubmit"));
   wait_for_search_results(w);
 
   // Click on the first address. This reveals the button with the price.
   let address = w.window.document.querySelector(".address:first-child");
   w.click(new elib.Elem(address));
-  w.waitFor(() => w.window.document.querySelectorAll("button.create:not([hidden=true])").length > 0);
+  w.waitFor(() => w.window.document.querySelectorAll('button.create:not([disabled="true"])').length > 0);
 
   // Pick the email address green@example.com
   plan_for_content_tab_load();
 
   // Clicking this button should close the modal dialog.
   let button = w.window.document.querySelector('button.create[address="green@example.com"]');
   w.click(new elib.Elem(button));
 }
@@ -899,22 +899,24 @@ function sub_get_to_order_form(aControll
   wait_for_search_ready(aController);
 
   // Fill in some data
   type_in_search_name(aController, "Joe Nobody");
 
   aController.click(aController.eid("searchSubmit"));
   wait_for_search_results(aController);
 
-  // Click on the first address. This reveals the button with the price.
-  let address = aController.window.document.querySelector(".address:first-child");
+  // Click on the requested address. This reveals the button with the price.
+  let addressElts = [...aController.window.document.querySelectorAll(".address")];
+  let address = addressElts.filter(a => a.textContent == aAddress).shift();
+  assert_true(!!address, "Couldn't find the requested address " + aAddress);
   aController.click(new elib.Elem(address));
-  aController.waitFor(() => aController.window.document.querySelectorAll("button.create:not([hidden=true])").length > 0);
+  aController.waitFor(() => aController.window.document.querySelectorAll('button.create:not([disabled="true"])').length > 0);
 
-  // Pick the email address green@example.com
+  // Pick the email address.
   plan_for_content_tab_load();
 
   // Clicking this button should close the modal dialog.
   let button = aController.window.document.querySelector('button.create[address="' + aAddress + '"]');
   // mc.click() causes a failure here so click() is used for now.
   button.click();
 }
 
@@ -1301,20 +1303,20 @@ function subtest_per_address_prices(w) {
       price = provider.parentNode.querySelector('.price');
       break;
     }
   }
   assert_equals(price.innerHTML, prices[0].slice(0, 6));
 
   // Click on the multi provider. This reveals the buttons with the prices.
   mc.click(new elib.Elem(multi));
-  mc.waitFor(() => w.window.document.querySelectorAll("button.create:not([hidden=true])").length > 0);
+  mc.waitFor(() => w.window.document.querySelectorAll('button.create:not([disabled="true"])').length > 0);
 
   // For each button, make sure it has the correct price.
-  let buttons = w.window.document.querySelectorAll("button.create:not([hidden=true])");
+  let buttons = w.window.document.querySelectorAll('button.create:not([disabled="true"])');
   let index = 0;
   for (let button of buttons) {
     // Emulate jquery's :visible selector
     if (button.offsetWidth == 0 && button.offsetHeight == 0) {
       continue;
     }
     assert_equals(button.innerHTML, prices[index]);
     index++;