VoiceXML application test framework.
A simple Java based VoiceXML application test framework. VoiceXMLRiot can simulate a call, drive inputs and verify responses. Standard operations provided by the VoiceXMLRiot driver are:
- get: Request a VoiceXML resource
- enterDtmf: Simulate DTMF input
- say: Simulate Voice input
- getTextResponse: Get a list of text (TTS) responses on the current VoiceXML page
- getAudioSrc: Get a list of audio (wav file) responses on the current VoiceXML page
Using these operations, VoiceXML application call flows can be simulated and responses verified.
See JVoiceXMLRiot JUnit Demo DemoIT.java for an example of how to initialize the Driver, drive a simple VoiceXML call flow and make assertions on the responses. This test uses JUnit but VoiceXMLRiot is test framework agnostic.
VoiceXMLRiot's design is inspired by the Selenium WebDriver. Selenium is not itself a test framework. Selenium provides simple commands for fetching HTML web pages and accessing the content of the page. When used with a test framework such as JUnit, it can drive interaction with a web application and make assertions on the correctness of responses.
VoiceXMLRiot is a headless browser for VoiceXML voice applications. VoiceXMLRiot is not in itself a test framework but does allow JUnit or similar to drive a VoiceXML application and make assertions on its correctness.
VoiceXMLRiot is based on the JVoiceXML Open Source VoiceXML interpreter. VoiceXMLRiot uses JVoiceXML in embedded mode using their provided Text server. It is not necessary to run a standalone JVoiceXML Voice Browser to use VoiceXMLRiot - the interpreter / voice browser is run in-process.
Comparison with JVoiceXML VoiceXMLUnit
VoiceXMLRiot differs from VoiceXMLUnit in the following ways:
- VoiceXMLRiot runs fully embedded within the test code. No need to run an external JVoiceXML server.
- VoiceXMLRiot parses the VoiceXML responses and provides simple access to the TTS text / audio response strings. No XML parsing required.
- VoiceXMLUnit provides simple assertions on TTS text / voice responses allowing exact match assertions only. VoiceXMLRiot provides direct access to the response strings allowing richer assertions, for example with Hamcrest matchers.
Binaries are available at the Disaster Area Maven Repo only. This repo also hosts the JVoiceXML dependencies.
To add this repo to a Maven build:
<repositories> <repository> <id>disasterarea</id> <name>Disaster Area</name> <url>https://maven.disasterarea.co.uk</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
Note that snapshot dependencies must be enabled for now as the JVoiceXML driver dependency is still in snapshot.