Opened 5 years ago
#1869 new enhancement
Translator test can't test pages that load content asynchronously
| Reported by: | ajlyon | Owned by: | ajlyon |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | translators | Version: | |
| Keywords: | Cc: | simon |
Description
In the Twitter translator that I just wrote (https://github.com/zotero/translators/blob/master/Twitter.js), the test never passes, since we don't wait for the actual page content to load. The tweet itself is loaded after we already have run detectWeb(..), which is I why I had to make detectWeb(..) return true immediately for all pages -- the real discrimination is done with the target regex. This works fine for regular use, since the user will generally not attempt to click the address bar icon before the visible page content has loaded.
But it'd be good to be able to somehow specify in the test that it should wait a certain period of time, or in general build a small wait into the testing process after the page loads-- the test framework is capable of running tests and clicking "Save this item to Zotero" much faster than a real user.