Events

For functional tests it can be useful to simulate event or record and playback events. This module provides basic support for extracting data from events and serializing events into a JSON format that allows to save and load sequences of events.

Let's look at an example of a HTML structure with click handlers. The click handler actions log messages that can be tested.


    <div>
        <img id="women" src="examples/women.jpeg"
            onclick="record(event); Doctest.log('Lady clicked')"/>
        <video id="movie" width="270" data-zoomcap="Kugellaufuhr"
            onclick="record(event); Doctest.log('Movie clicked')"
            controls>
            <source src="examples/movie.mp4" type="video/mp4">
        </vide>
    </div>

References