From c2d32c2e271114c41785226eb46f41332a66077c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 9 Mar 2015 14:39:04 -0400 Subject: [PATCH] Just give up on trying to automate the panel itself --- chrome/content/zotero/bindings/guidancepanel.xml | 1 + defaults/preferences/zotero.js | 1 + test/runtests.sh | 2 ++ test/tests/lookup.js | 15 ++++----------- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml index 41560f908f..12f40106a6 100644 --- a/chrome/content/zotero/bindings/guidancepanel.xml +++ b/chrome/content/zotero/bindings/guidancepanel.xml @@ -36,6 +36,7 @@ "$PROFILE/extensions/zotero@chnm.gmu.edu" cat < "$PROFILE/prefs.js" user_pref("extensions.autoDisableScopes", 0); user_pref("extensions.zotero.debug.log", $DEBUG); +user_pref("extensions.zotero.firstRunGuidance", false); +user_pref("extensions.zotero.firstRun2", false); EOF MOZ_NO_REMOTE=1 NO_EM_RESTART=1 "$FX_EXECUTABLE" -profile "$PROFILE" \ diff --git a/test/tests/lookup.js b/test/tests/lookup.js index c17786c94b..769fcd2a56 100644 --- a/test/tests/lookup.js +++ b/test/tests/lookup.js @@ -1,15 +1,8 @@ function lookupIdentifier(win, identifier) { - var tbbutton = win.document.getElementById("zotero-tb-lookup"); - tbbutton.open = true; - return waitForDOMEvent(win.document.getElementById("zotero-lookup-panel"), "popupshown").then(function() { - tbbutton.open = true; // Shouldn't be necessary, but seems to be on Fx ESR under Xvfb - var textbox = win.document.getElementById("zotero-lookup-textbox"); - textbox.value = identifier; - textbox.focus(); - EventUtils.synthesizeKey("VK_RETURN", {}, win); - var closePromise = waitForDOMEvent(win.document.getElementById("zotero-lookup-panel"), "popuphidden"); - return waitForItemEvent("add"); - }); + var textbox = win.document.getElementById("zotero-lookup-textbox"); + textbox.value = identifier; + win.Zotero_Lookup.accept(textbox); + return waitForItemEvent("add"); } describe("Add Item by Identifier", function() {