Testing: Selenium: ZimbraSelenium CodeCoverage
General Information
The Zimbra Selenium Harness contains code to measure code coverage using JSCoverage.
Code coverage statistics are gathered for the javascript clients, the ajax client and the admin console.
Design
The harness uses jscoverage-server mode, where jscoverage.html is not required. Therefore, the code coverage does not require the zimbra application to run inside a containing window. See JSCoverage documentation for more details.
JSCoverage
JSCoverage install
Code Coverage depends on having jscoverage installed on the server in /usr/local/bin/jscoverage, which corresponds to the coverage.tool property in ZimbraSelenium/conf/config.properties.
Don't use the apt-get install jscoverage, that doesn't seem to work correctly. Instead, get the source zip and compile. Then, copy/link /usr/local/bin/jscoverage to the built files.
JSCoverage instrumentation
To manually instrument the server, the command is (as root):
/usr/local/bin/jscoverage --no-instrument=help/ /opt/zimbra/jetty/webapps/zimbra /opt/zimbra/jetty/webapps/instrumented
Design
Configuration
Logging
Coverage reporting
After executing the harness, the output will be written to ZimbraSelenium/test-output/.../coverage/jscoverage.html