From f6510419cbe32832a76a556564deb0457199d53c Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Mon, 30 Mar 2015 23:52:38 -0500 Subject: [PATCH] Skip test for "recognizePDF without DOI" on Travis-CI Breaks due to CAPTCHA when tests are run frequently --- chrome/content/zotero/xpcom/zotero.js | 1 + components/zotero-service.js | 4 ++++ test/runtests.sh | 6 +++++- test/tests/recognizePDF.js | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 799156335..221765c0a 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -210,6 +210,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); if (options) { if (options.openPane) this.openPane = true; + if (options.noUserInput) this.noUserInput = true; } this.mainThread = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread; diff --git a/components/zotero-service.js b/components/zotero-service.js index 389185bc5..111005c64 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -447,6 +447,10 @@ ZoteroCommandLineHandler.prototype = { } } } + + if (cmdLine.handleFlag("ZoteroNoUserInput", false)) { + zInitOptions.noUserInput = true; + } }, contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=zotero", diff --git a/test/runtests.sh b/test/runtests.sh index 27cf5b633..6da6f8796 100755 --- a/test/runtests.sh +++ b/test/runtests.sh @@ -77,11 +77,15 @@ user_pref("extensions.zotero.firstRunGuidance", false); user_pref("extensions.zotero.firstRun2", false); EOF - +# -v flag on Windows makes Firefox process hang if [ -z $IS_CYGWIN ]; then echo "`MOZ_NO_REMOTE=1 NO_EM_RESTART=1 \"$FX_EXECUTABLE\" -v`" fi +if [ "$TRAVIS" = true ]; then + FX_ARGS="$FX_ARGS --ZoteroNoUserInput" +fi + makePath FX_PROFILE "$PROFILE" MOZ_NO_REMOTE=1 NO_EM_RESTART=1 "$FX_EXECUTABLE" -profile "$FX_PROFILE" \ -chrome chrome://zotero-unit/content/runtests.html -test "$TESTS" $FX_ARGS diff --git a/test/tests/recognizePDF.js b/test/tests/recognizePDF.js index 670422748..2bbb07368 100644 --- a/test/tests/recognizePDF.js +++ b/test/tests/recognizePDF.js @@ -38,6 +38,8 @@ describe("PDF Recognition", function() { }); it("should recognize a PDF without a DOI", function() { + if (Zotero.noUserInput) this.skip(); // CAPTCHAs make this fail + this.timeout(30000); // Import the PDF var testdir = getTestDataDirectory();