Bug 1590682 - Fix "event-all-day could not be checked/unchecked" failure; r+a=pmorris
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 23 Oct 2019 23:28:22 +1300
changeset 36379 f1bad99f776077731e4fc1c9878c62d7edd5b75b
parent 36378 163dc9241deb5eaaf7d3295a7aa19f18bb2c45d0
child 36380 4820421dbf43d8325038dab2f5070cc60268533f
push id2521
push usermozilla@jorgk.com
push dateWed, 06 Nov 2019 09:31:04 +0000
treeherdercomm-beta@308f336efa3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1590682
Bug 1590682 - Fix "event-all-day could not be checked/unchecked" failure; r+a=pmorris
calendar/test/modules/ItemEditingHelpers.jsm
--- a/calendar/test/modules/ItemEditingHelpers.jsm
+++ b/calendar/test/modules/ItemEditingHelpers.jsm
@@ -33,16 +33,17 @@ var {
 var { mark_failure } = ChromeUtils.import(
   "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
 );
 var { augment_controller, plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
+var { Assert } = ChromeUtils.import("resource://testing-common/Assert.jsm");
 
 // Lookup paths and path-snippets.
 // These 5 have to be used with itemEditLookup().
 var CATEGORY_LIST = `
     id("event-grid")/id("event-grid-category-color-row")/id("event-grid-category-color-td")
     /id("item-categories")/id("item-categories-popup")
 `;
 var REPEAT_DETAILS = `
@@ -239,17 +240,21 @@ function setData(dialog, iframe, data) {
 
   // calendar
   if (data.calendar != undefined) {
     menulistSelect(iframeid("item-calendar"), data.calendar, dialog);
   }
 
   // all-day
   if (data.allday != undefined && isEvent) {
-    dialog.check(iframeid("event-all-day"), data.allday);
+    let checkbox = iframeid("event-all-day");
+    if (checkbox.getNode().checked != data.allday) {
+      dialog.click(checkbox);
+    }
+    Assert.equal(checkbox.getNode().checked, data.allday);
   }
 
   // timezonedisplay
   if (data.timezonedisplay !== undefined) {
     let menuitem = eid("options-timezones-menuitem");
     if (menuitem.getNode().getAttribute("checked") != data.timezonedisplay) {
       dialog.click(menuitem);
     }