Bug 1502997 - Access pref-category-box id properly for an anonymous element. rs=bustage-fix,jorgk
authoraceman <acelists@atlas.sk>
Tue, 30 Oct 2018 22:13:10 +0100
changeset 33624 9da5d0b8fa8046c88dcbc9154e67e00ba9693ce7
parent 33623 13e1bf3609be5c2d39f126ad3df2e5aa39f78fdc
child 33625 02c01fa93db94df7d3a2fed728d5994c4e0e634f
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersbustage-fix, jorgk
bugs1502997
Bug 1502997 - Access pref-category-box id properly for an anonymous element. rs=bustage-fix,jorgk
calendar/test/mozmill/shared-modules/test-calendar-utils.js
--- a/calendar/test/mozmill/shared-modules/test-calendar-utils.js
+++ b/calendar/test/mozmill/shared-modules/test-calendar-utils.js
@@ -612,17 +612,19 @@ function findEventsInNode(node, eventNod
         }
     }
 }
 
 function openLightningPrefs(aCallback, aParentController) {
     // Since the Lightning pane is added after load, asking for it with open_pref_tab won't work.
     // Cheat instead.
     let tab = open_pref_tab("paneGeneral");
-    tab.browser.contentDocument.querySelector('#pref-category-box radio[pane="paneLightning"]').click();
+    let categoryBox = tab.browser.contentDocument.getAnonymousElementByAttribute(
+        tab.browser.contentDocument.documentElement, "id", "pref-category-box");
+    categoryBox.querySelector('radio[pane="paneLightning"]').click();
     utils.waitFor(
         () => tab.browser.contentDocument.documentElement.currentPane.id == "paneLightning",
         "Timed out waiting for prefpane paneLightning to load."
     );
     aCallback(tab);
 }
 
 /**