zotero/test/tests/preferences_searchTest.js
Dan Stillman da627e137a Add waitForDialog(onOpen, button) support function
Waits for an alert or confirmation dialog to open and closes it
automatically, optionally after running onOpen(dialog) to check its
contents (e.g., with dialog.document.documentElement.textContent) and
optionally clicking a button other than 'accept' (e.g., 'cancel',
extra1').

Supports delayed accept buttons
2015-06-04 20:31:48 -04:00

20 lines
634 B
JavaScript

describe("Search Preferences", function () {
describe("PDF Indexing", function () {
it("should install PDF tools if not installed", function* () {
// Begin install procedure
var win = yield loadWindow("chrome://zotero/content/preferences/preferences.xul", {
pane: 'zotero-prefpane-search',
action: 'pdftools-install'
});
// Wait for confirmation dialog
yield waitForDialog();
// Wait for install to finish
yield waitForCallback(function() {
return Zotero.Fulltext.pdfConverterIsRegistered()
&& Zotero.Fulltext.pdfInfoIsRegistered();
}, 500)
.finally(() => win.close());
})
})
})