Bug 1500475 - Modify browser_jsterm_content_defined_helpers.js to find cause of intermittent; r=bgrins.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Fri, 19 Oct 2018 16:12:13 +0000
changeset 490518 a159b99e2a0b8516b852e47e257c8752fa3b55b6
parent 490517 d38486cbad8d8388fa3596139473b89ef35b9821
child 490519 4a81fd6046965751585ae7b85740417bb542aa04
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersbgrins
bugs1500475
milestone64.0a1
Bug 1500475 - Modify browser_jsterm_content_defined_helpers.js to find cause of intermittent; r=bgrins. The log we currently receive are not really actionable (we are using ok, so we don't know what the received value actually is). Switching to is should give us what the value is when the test fails, which might help us fix the failure. Differential Revision: https://phabricator.services.mozilla.com/D9270
devtools/client/webconsole/test/mochitest/browser_jsterm_content_defined_helpers.js
--- a/devtools/client/webconsole/test/mochitest/browser_jsterm_content_defined_helpers.js
+++ b/devtools/client/webconsole/test/mochitest/browser_jsterm_content_defined_helpers.js
@@ -50,15 +50,16 @@ async function performTests() {
   const {autocompletePopup} = jsterm;
 
   for (const helper of HELPERS) {
     await setInputValueForAutocompletion(jsterm, helper);
     const autocompleteItems = getPopupLabels(autocompletePopup).filter(l => l === helper);
     is(autocompleteItems.length, 1,
       `There's no duplicated "${helper}" item in the autocomplete popup`);
     const msg = await jsterm.execute(`${helper}()`);
-    ok(msg.textContent.includes(PREFIX + helper), `output is correct for ${helper}()`);
+    is(msg.textContent.trim(), `"${PREFIX + helper}"`,
+      `output is correct for ${helper}()`);
   }
 }
 
 function getPopupLabels(popup) {
   return popup.getItems().map(item => item.label);
 }