Bug 1387704 - ensure tag label buttons are visible in quick-filter-bar/test-filter-logic.js. r=jorgk
authoraceman <acelists@atlas.sk>
Sat, 22 Sep 2018 13:17:00 +0200
changeset 33210 32fc6e969e2775c24a43e412d547f7fdec798b3a
parent 33209 185f455ddd94567fc4df938d48ea91430baa90f9
child 33211 e1b439708ed09605a6a9331fd4d7263ee41b807b
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersjorgk
bugs1387704
Bug 1387704 - ensure tag label buttons are visible in quick-filter-bar/test-filter-logic.js. r=jorgk
mail/test/mozmill/quick-filter-bar/test-display-issues.js
mail/test/mozmill/quick-filter-bar/test-filter-logic.js
mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js
--- a/mail/test/mozmill/quick-filter-bar/test-display-issues.js
+++ b/mail/test/mozmill/quick-filter-bar/test-display-issues.js
@@ -11,29 +11,33 @@
 
 "use strict";
 
 var MODULE_NAME = "test-display-issues";
 
 var RELATIVE_ROOT = '../shared-modules';
 
 var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
-                       'quick-filter-bar-helper'];
+                       "quick-filter-bar-helper", "dom-helpers"];
 
 var folder;
 var setUnstarred, setStarred;
+var gOriginalPaneWidth;
 
 function setupModule(module) {
-  collector.getModule('folder-display-helpers').installInto(module);
-  collector.getModule('window-helpers').installInto(module);
-  collector.getModule('quick-filter-bar-helper').installInto(module);
-  collector.getModule("dom-helpers").installInto(module);
-
+  for (let lib of MODULE_REQUIRES) {
+    collector.getModule(lib).installInto(module);
+  }
   folder = create_folder("QuickFilterBarDisplayIssues");
   be_in_folder(folder);
+  // Let's check window sizes as we will restore back to them after the end of the test.
+  assert_equals(mc.window.outerWidth, 1024, "Main window didn't meet the expected width");
+  assert_equals(mc.window.outerHeight, 768, "Main window didn't meet the expected height");
+  let folderPaneBox = mc.e("folderPaneBox");
+  gOriginalPaneWidth = folderPaneBox.width;
 }
 
 function wait_for_resize(width) {
   mc.waitFor(() => (mc.window.outerWidth == width),
              "Timeout waiting for resize (is the screen resolution 1280 x 1024?)", 1000, 50);
 }
 
 function resize_to(width, height) {
@@ -154,9 +158,11 @@ function test_buttons_collapse_and_expan
 }
 
 function teardownModule() {
   // restore window to nominal dimensions; saving was not working out
   //  See also: message-header/test-message-header.js if we change the
   //            default window size.
   resize_to(1024, 768);
   collapse_panes(mc.e("folderpane_splitter"), false);
+  let folderPaneBox = mc.e("folderPaneBox");
+  folderPaneBox.width = gOriginalPaneWidth;
 }
--- a/mail/test/mozmill/quick-filter-bar/test-filter-logic.js
+++ b/mail/test/mozmill/quick-filter-bar/test-filter-logic.js
@@ -163,17 +163,16 @@ function test_filter_tags() {
   toggle_boolean_constraints("tags");
   toggle_tag_constraints(tagC);
   assert_messages_in_view(setTagC);
 
   toggle_boolean_constraints("tags"); // no constraints
   toggle_boolean_constraints("tags"); // should be any tag (not tagC!)
   assert_messages_in_view([setTagA, setTagB, setTagAB, setTagC]);
 }
-test_filter_tags.EXCLUDED_PLATFORMS = ["darwin", "linux"];  // See bug 1387704.
 
 function test_filter_text_single_word_and_predicates() {
   let folder = create_folder("QuickFilterBarTextSingleWord");
   let whoFoo = ["zabba", "foo@madeup.invalid"];
   let [setInert, setSenderFoo, setRecipientsFoo, setSubjectFoo, setBodyFoo] =
     make_new_sets_in_folder(folder, [
       {count: 1}, {count:1, from: whoFoo}, {count: 1, to: [whoFoo]},
       {count: 1, subject: "foo"}, {count: 1, body: {body: "foo"}}]);
--- a/mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js
+++ b/mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js
@@ -115,17 +115,22 @@ function toggle_boolean_constraints(...a
   aArgs.forEach(arg => mc.click(mc.eid(nameToBarDomId[arg])));
   fdh.wait_for_all_messages_to_load(mc);
 }
 
 /**
  * Toggle the tag faceting buttons by tag key.  Wait for messages after.
  */
 function toggle_tag_constraints(...aArgs) {
-  aArgs.forEach(arg => mc.click(mc.eid("qfb-tag-" + arg)));
+  let qfbButtons = mc.e("quick-filter-bar-tab-bar");
+  aArgs.forEach(function(arg) {
+    let tagId = "qfb-tag-" + arg;
+    qfbButtons.ensureElementIsVisible(mc.e(tagId));
+    mc.click(mc.eid(tagId));
+  });
   fdh.wait_for_all_messages_to_load(mc);
 }
 
 /**
  * Set the tag filtering mode. Wait for messages after.
  */
 function toggle_tag_mode() {
   let qbm = mc.e("qfb-boolean-mode");