Commit graph

128 commits

Author SHA1 Message Date
Dan Stillman
9c91018964 Reduce indentation in waitForWindow() support function 2017-04-13 05:51:52 -04:00
Dan Stillman
7609ef35bc Allow setting note text with createDataObject('item') test function 2017-04-01 14:28:32 -04:00
Dan Stillman
bb489a45c3 Upload modified items after tag rename
The web library will probably still display the old tag in addition to
the new one, at least until browser restart. We'll have to deal with
that separately.

Closes #1205
2017-04-01 02:54:24 -04:00
Dan Stillman
820755e152 Rework libraryTreeView event handling
Changes `libraryTreeView::addEventListener('load')` and similar to
`libraryTreeView::onLoad.addListener(listener, once)`, etc. `once` is an
optional boolean that, when true, causes the listener to fire once and
then be removed. This is implicit for 'load'.

'load' maintains its special behavior of running immediately if the
treeview has already been loaded.

Also adds `waitForLoad()` and `waitForSelect()` functions that return
promises on event completion, since most uses of those events were just
resolving deferreds.
2017-03-24 05:23:56 -04:00
Dan Stillman
1a4b7121d3 Move waitForTagSelector() into support.js 2017-03-24 00:51:25 -04:00
Dan Stillman
640aaa1557 Add loadPrefPane(paneName) support function
E.g., loadPrefPane('sync') to open the prefs and select the
'zotero-pane-sync' pane
2017-03-13 16:02:34 -07:00
Dan Stillman
a35d903e77 Increase size of browser window during tests
Makes it easier to manually increase Zotero pane before a timeout while
debugging (though the page should just be made bigger by default)
2017-02-27 04:54:11 -05:00
Dan Stillman
9ac458e05c Add 'archived' property to Zotero.Library objects
Set when a user loses access to a library but chooses to keep it as a
read-only library.
2017-02-24 02:36:18 -05:00
Dan Stillman
d32f23471e Fix setting of libraryID in createDataObject() support function
When another property was also set, setting libraryID would fail.
2017-02-21 00:04:53 -05:00
Dan Stillman
a43f9d16ac Allow number or name for translator type in buildDummyTranslator()
This reverts c6b78da69d, which changed it to expect numbers when I
noticed the type being undefined in debug output, but apparently the
only tests where the type actually mattered passed it as a name.

At some point we should just change all tests to pass as a name.
2017-01-23 09:13:44 -05:00
Dan Stillman
c6b78da69d Fix translatorType in dummy translators in tests 2017-01-23 07:02:08 -05:00
Dan Stillman
238ab80699 Add -s flag to runtests.sh to start at given file
Useful for restarting after spurious errors when using -f

E.g., ./runtests.sh -s syncEngine
2016-12-16 04:21:37 -05:00
Adomas Ven
d6d4e4b33e Saner feed database management (#1131)
* Mark feedItems read in a single batch SQL update
* Automatically remove old feed items
* User-facing preference globally and per-feed for feed item expiration
2016-12-13 09:07:43 -05:00
Adomas Ven
747c11c917 Improves proxy support (#1129)
Improves proxy support

- Automatically detect and dehyphenise https proxies which use EZProxy
  HttpsHyphens
- Web translators now pass around Zotero.Proxy instances which can
  proxify/deproxify urls passed to `translate.setLocation()` before calling
  `translate.getTranslators()`/ translate.detect()`. The proxy passing is
  done within connector background/injected processes and between
  standalone and connectors.
- Proxy protocol unified with connectors. Connectors can now pass
  proxies to `/connector/save_items`. The proxies will be used to resolve
  true item and attachment urls when saving.

Closes zotero/zotero#578, zotero/zotero#721

Relevant zotero/zotero#34, zotero/zotero#556
2016-12-12 14:29:59 +02:00
Dan Stillman
4f44cc10ce Avoid CustomizableUI warnings in console after resetDB() during tests 2016-11-30 21:18:31 -05:00
Dan Stillman
8f0ed56ae2 Test fixes after 5bceebf56c 2016-11-29 03:52:07 -05:00
Dan Stillman
5bceebf56c Reset Zotero prefs after each suite and when resetting DB
But keep prefs set in runtests.sh
2016-11-29 03:27:44 -05:00
Dan Stillman
a735d5dd41 Remove Travis debugging 2016-11-27 20:02:53 -05:00
Dan Stillman
3a9cd31d42 Travis debugging 2016-11-27 19:46:12 -05:00
Dan Stillman
5a6f1eef63 Update deprecated uses of Zotero.getZoteroDirectory()/getZoteroDatabase()
The Zotero.DataDirectory equivalents return string paths instead of nsIFile
instances, so some of these calls now just use Zotero.File.pathToFile(), which
can be removed when the surrounding code is updated to OS.File,
2016-11-27 00:17:56 -05:00
Dan Stillman
4c0abb6816 Point other profiles to new data dir after migration (+ code reorg)
Look for other profiles, from both apps (Firefox and Standalone), that
point to the data directory being migrated and update prefs.js in those
profiles to point to the new location.

Also reorganize code into Zotero.Profile and Zotero.DataDirectory
namespaces
2016-11-27 00:17:56 -05:00
Dan Stillman
6d07cb44df Fix Travis errors due to broken DirectoryIterator 2016-11-19 18:52:10 -05:00
Adomas Venčkauskas
5d17ff3f53 Implements #1021 on Z4fx extension 2016-09-27 17:43:56 +03:00
Adomas Venčkauskas
7608e127f1 Fix nested translators that rely on child translator tags 2016-09-21 11:54:56 +03:00
Adomas Venčkauskas
e83bbbad4e Fix getTranslatorCode bugs
- /connector/getTranslatorCode used to respond with empty content
- CodeGetter froze connectors by issuing hundreds of simultanious XHR
  requests
2016-09-20 15:55:58 +03:00
Dan Stillman
08b62f41e0 Log opened windows in waitForWindow() test support function 2016-09-06 19:16:30 -04:00
Dan Stillman
0eb6dc9ca5 Merge branch '4.0' 2016-08-09 01:52:21 -04:00
Dan Stillman
ed9e655871 Pass correct event name to removeEventListener in support function 2016-07-23 16:27:44 -04:00
Dan Stillman
ac34f2c4f4 Allow additional options for support test functions
- libraryVersion for createGroup()
- Zotero.Item save options for importFileAttachment()
2016-07-19 18:54:37 -04:00
Dan Stillman
c1f7a188e2 Fix error modifying existing saved search with more than 1 condition
Closes #1056, which wasn't actually the problem
2016-07-07 07:55:15 -04:00
Dan Stillman
5740d4729d Use random title in search condition in createDataObject() test function
Can be retrieved with search.getConditions()[0].value and included in an item
title to have an item match the created search
2016-07-06 02:04:53 -04:00
Dan Stillman
7e5b46b146 Merge pull request #1048 from adomasven/fix/linux-test-failures
Fixes freezing occuring on linux while running tests
2016-06-25 07:30:35 -04:00
Dan Stillman
2d88b07855 Set Zotero.automatedTest flag instead of .noUserInput on Travis
And don't skip alerts in Zotero.alert() during automated tests. (That
was intended to avoid long timeouts after unexpected failures, but,
e.g., PDF metadata lookups (which are currently disabled in automated
tests) should just be mocked so they don't intermittently fail.)
2016-06-24 18:28:32 -04:00
Adomas Venčkauskas
3f25d64984 Fixes freezing occuring on linux while running tests
server_connectorTest - alternating port prevents
exceptions not catchable in JS for httpd server when the socket
and the port remains open after httpd.stop() callback

support - changes the window on which `setTimeout()` is ran in dialogs.
If the timeout is ran on the main window the `dialog` object appears to
lose certain properties and not respond to interactions completely.
2016-06-23 16:15:48 +03:00
Dan Stillman
c2dd531cec Fix waitForDialog() with modal dialogs in popup windows (e.g., prefs) 2016-06-22 15:46:44 -04:00
Dan Stillman
6b0be91bf4 Clear lastViewedFolder pref when resetting DB during tests 2016-05-23 00:59:16 -04:00
Dan Stillman
2a8cd27b49 Increase default test timeout to 10000 2016-04-26 21:46:05 -04:00
Dan Stillman
4e50b7ddc2 Increase default test timeout to 10 seconds on Travis
Maybe this will fix some of the intermittent failures...
2016-04-26 02:43:44 -04:00
Dan Stillman
0469d6506a Show toolbar icon and collections pane while items are loading
Items in a library are now loaded only when a library is clicked on and
at sync time. There might be some other areas where they need to be
loaded or where this causes problems (e.g., drag and drop, word
processor integration).
2016-04-10 19:01:36 -04:00
Dan Stillman
35530af1fb Gzip-compress API uploads larger than 1000 characters 2016-03-28 02:38:28 -04:00
Dan Stillman
b7b246e741 Saved search fixes
- Fix saved search editing
- Refresh items list on search change
- Generate correct conditions array for search JSON
2016-03-26 04:14:56 -04:00
Dan Stillman
6c43e75d26 Merge pull request #902 from adomasven/feature/feed-reader-UI
Feed Reader UI

(I squashed a bunch of commits from the PR.)
2016-03-22 07:31:03 -04:00
Adomas Venčkauskas
12fc6cfbe8 Various feeds changes
- Hide notes, tags and related for feed items in itembox
- Add feed support for <enclosure> elements
- Add feed syncing methods for synced settings (additional work is
  needed on the sync architecture to download synced settings from the
  server)
- Change feed item clear policy to be less aggressive
- Adjust for deasyncification
- Disable translate-on-select
- Close adomasven/zotero#7, Remove context menu items from feeds
2016-03-22 06:56:36 -04:00
Adomas Venčkauskas
e6ede4b36f Various feeds changes
And move Z.Attachments.cleanAttachmentURI() to Z.Utilities.cleanURL()
2016-03-22 06:56:30 -04:00
Adomas Venčkauskas
8a2dc6e7f2 Adds Zotero.FeedReader tests 2016-03-22 06:56:29 -04:00
Dan Stillman
74cf2a3c22 Fix hang on import that includes an HTML attachment
Closes #734, for the moment
2016-03-22 01:31:20 -04:00
Dan Stillman
e70f2164c1 Fix broken support test after 220cf2c29 2016-03-21 01:33:37 -04:00
Dan Stillman
20ece48a57 Fix saving of single files to library root via save button 2016-03-21 01:30:16 -04:00
Dan Stillman
b9444892a0 Ring bell on test error if interactive shell 2016-03-15 01:18:55 -04:00
Dan Stillman
6b509820b3 Fixes #918, Enabling "Show Unfiled Items" or "Show Duplicates" breaks UI 2016-03-13 20:31:15 -04:00