|
|
# Current Status
|
|
|
# TestSuite
|
|
|
|
|
|
**Note: this page was initially written as a plan for a test suite. Since that time, most of the tests mentioned and many others have been written.**
|
|
|
|
|
|
## Current Status
|
|
|
|
|
|
Currently, the `test/` directory contains various test pages. Here is those available on Sean's repository:
|
|
|
|
... | ... | @@ -16,7 +20,7 @@ Currently, the `test/` directory contains various test pages. Here is those avai |
|
|
* sample-signals.html: a basic page demonstrating how to use MathJax's signal mechanism to find out about what MathJax is doing, and to hook into various events as they occur.
|
|
|
* sample-dynamic.html: a simple demonstraton of programming with MathJax to update math on the page in response to user input.
|
|
|
|
|
|
# Terminology and general remarks
|
|
|
## Terminology and general remarks
|
|
|
|
|
|
* reftest: two webpages (test and reference) which are expected to provide the same output. This output can be the visual rendering, the tree built etc. The reftest can be == (test and reference are expected to be equal) or != (test and reference are expected to be different).
|
|
|
* crashtest / "load" test: a single webpage which ends by a "success" javascript event. The test consists in loading the patch and listening for the "success" event (test passed). The test is interrupted after a timeout or a browser crash (test fails).
|
... | ... | @@ -30,7 +34,7 @@ Some remarks: |
|
|
* Some results depend on the browsers, the fonts installed etc and tests may be hard to designed for them.
|
|
|
* To make the tests independent from the testing framework, it may be best to write it with webpages using only javascript. For instance, one can simulate mouse events or compare tree structures using only javascript. The testing framework would be used only to collect the results, take screenshots of visual renderings or other features not available in javascript.
|
|
|
|
|
|
# Accessibility
|
|
|
## Accessibility
|
|
|
|
|
|
* copy-and-paste: a scenario test which uses MathJax menu to copy the LaTeX/MathML source and paste it in a textarea. The content of the textarea is then compared against the original source.
|
|
|
* scale all math: several scenario tests which use MathJax menu to set the scale factor and compare the rendering against reference pages (using zscale).
|
... | ... | @@ -42,15 +46,15 @@ Some remarks: |
|
|
|
|
|
What about I18N support?
|
|
|
|
|
|
# MathML/LaTeX
|
|
|
## MathML/LaTeX
|
|
|
|
|
|
* reftests covering all the LaTeX commands supported
|
|
|
* reftests covering all the MathML elements and attributes supported
|
|
|
* import Mozilla MathML reftests when possible (done)
|
|
|
* import MathML3 testsuite reftests when possible
|
|
|
|
|
|
# Configuration
|
|
|
## Contexts
|
|
|
## Configuration
|
|
|
### Contexts
|
|
|
|
|
|
* HTML/XHTML pages. Two pages xhtml-1.xhtml (in XHTML format) basic-ref.html (in HTML format) with a same basic formula (== reftest).
|
|
|
* pages served with/without application/xhtml+xml MIME-type. Two pages xhtml-2.html and basic-ref.html with the same set of formula (== reftest). Use a .htaccess to map the first one to the application/xhtml+xml MIME type. If the reftest is not run on a server, the test will just be passed.
|
... | ... | @@ -61,7 +65,7 @@ What about I18N support? |
|
|
* inside script type="math/mml" or type="math/tex". math-location-i.html (math written inside a script element) and basic.html (== reftests).
|
|
|
* `<foreignObject/>` in SVG diagrams (not mentioned in the doc, not sure it works). svg-1.html, svg-1-ref.html (!= reftest). The test has MathML in a foreignObject, the reference has not.
|
|
|
|
|
|
## Main configurations
|
|
|
### Main configurations
|
|
|
|
|
|
* extensions "tex2math.js","TeX/noErrors.js","TeX/noUndefined.js", "TeX/AMSmath.js","TeX/AMSsymbols.js", "mml2jax.js". Different pages using macros specific to each package (load test).
|
|
|
* config: "MMLorHTML.js". mml-or-html-1.html, mml-or-html-1-ref.html. Compare the result against a reference page using "output/HTML-CSS" and "output/NativeMML" according to the browser tested. (== reftest)
|
... | ... | @@ -69,7 +73,7 @@ What about I18N support? |
|
|
* jax "input/TeX", "input/MathML". Reftests against static pages where only the TeX/MathML elements have been replaced by a HTML-CSS output. (== refests)
|
|
|
* jax "output/HTML-CSS", "output/NativeMML". comparison against a static MathML page. (!= and == reftests)
|
|
|
|
|
|
## Other options
|
|
|
### Other options
|
|
|
|
|
|
* The Core Configuration Options
|
|
|
* config: (== reftests). For config, test a local config.js, not the predefined MMLorHTML.js
|
... | ... | @@ -113,8 +117,8 @@ What about I18N support? |
|
|
* The FontWarnings options
|
|
|
* messageStyle, Message, HTML, removeAfter, fadeoutSteps, fadeoutTime: several reftests to see how the warnings are displayed with respect to the setting of each individual option. All these tests may be complicated by the fact that they depend on the environment (browsers, fonts...).
|
|
|
|
|
|
# MathJax API
|
|
|
## Main API
|
|
|
## MathJax API
|
|
|
### Main API
|
|
|
|
|
|
* Startup Sequence:
|
|
|
* listen all the signals and check that they match the standard list (load test).
|
... | ... | @@ -131,7 +135,7 @@ What about I18N support? |
|
|
* name, posted, listeners, Post, Clear, Interest, NoInterest, MessageHook, ExecuteHook
|
|
|
* Modifying Math on the Page: several unit tests for Typeset, Text, Remove, SourceElement, PreProcess, Process, Update, Reprocess. check that the dynamic updates happen as expected.
|
|
|
|
|
|
## Detailed API
|
|
|
### Detailed API
|
|
|
|
|
|
* The MathJax variable
|
|
|
* MathJax.*: several test pages that check whether the Main MathJax Components exist
|
... | ... | |