Most of the usefulness of unit test environment comes from their ability to automate the tests.
With the principles used in this project, automation can be achieved by submitting the tests results once they become available. Translated into XForms terms, this means submitting the results in an action at the end of test which are themselves triggered by an xforms-ready event .
For server side implementations, using a submission with @replace=”all” makes a lot of sense because the tests can be performed server side without any browser interaction and directly return test results.
The basic feature to enable this is thus the ability to perform submissions with @replace=”all” on xforms-ready events.
This simple repro case checks this ability:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
<title>Submission on xforms-ready</title>
<xf:submission id="echo" ref="instance('instance')" method="POST"
<xf:send ev:event="xforms-ready" submission="echo"/>
Unfortunately this does work with Orbeon Forms but not with betterFORM nor with XSLTForms.
I have created a page to document XForms interoperability issues, hoping that this work may be useful for others.
To come back to test automation, Orbeon Forms has defined an extension to perform local echo submissions without client/server interactions. With this extension you don’t have to rely on a web service to replace the page by its test instance and that facilitates the development of automated tests running in pipelines.
Of course this won’t be possible with a client side implementation such as XSLTForms and for these implementations we will probably have to run a browser on a virtual screen such as Xvfb.