Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:translators:testing [2012/02/23 01:12] – [Structure] ajlyon | dev:translators:testing [2017/11/12 19:53] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < | ||
+ | in the process of updating the documentation for | ||
+ | <a href=" | ||
+ | may be outdated in the meantime. Thanks for your understanding.</ | ||
+ | |||
+ | |||
====== Translator Testing ====== | ====== Translator Testing ====== | ||
In order to provide consistent and reliable operation on a variety of pages and inputs, it is possible to define tests for import, web, and search translators. These tests are defined as a JSON blocks within the translator text, including the input URL or text, and the expected result from running the translator on that input. A translator that provides good test coverage of its functionality can then be more easily maintained-- in the case of input translators, | In order to provide consistent and reliable operation on a variety of pages and inputs, it is possible to define tests for import, web, and search translators. These tests are defined as a JSON blocks within the translator text, including the input URL or text, and the expected result from running the translator on that input. A translator that provides good test coverage of its functionality can then be more easily maintained-- in the case of input translators, | ||
Line 24: | Line 30: | ||
/** END TEST CASES **/</ | /** END TEST CASES **/</ | ||
- | In some cases, a translator test may fail where the translator itself would not, since it runs immediately upon the target page loading. In such cases, set <tt>" | + | In some cases, a translator test may fail where the translator itself would not, since it runs immediately upon the target page loading. In such cases, set '' |
<code javascript> | <code javascript> | ||
" | " | ||
Line 32: | Line 38: | ||
}</ | }</ | ||
- | Note that Scaffold does not currently produce or maintain the defer annotation, so it will need to be added manually, rather than generated using Scaffold' | + | Note that Scaffold does not currently produce or maintain the defer annotation, so it will need to be added manually, rather than generated using Scaffold' |
===== Running tests ===== | ===== Running tests ===== | ||
An overview of the currently installed translators, | An overview of the currently installed translators, | ||
Line 40: | Line 46: | ||
===== Automated Testing ===== | ===== Automated Testing ===== | ||
- | The translator tests are run daily at 9 pm EST by the Zotero project to detect new failures and incompatibilities. Test results are available at http:// | + | The translator tests are run daily at 9 pm EST by the Zotero project to detect new failures and incompatibilities. Test results are available at https:// |
+ | |||
+ | ====== Further Reading ====== | ||
+ | |||
+ | More detailed instructions are available at [[https:// |