Automate the HTML preview capture process
Rigi works with any automated UI testing framework. You can easily integrate the capturing of Rigi HTML previews into existing UI testing environments.
Developers and testers often use automated UI tests. These tests contain scripts that navigate through an application, enter field values, select items from lists, etc. A script compares the presented result with the expected outcome and can provide errors and warnings.
Some of the commonly used frameworks are Selenium, Karma, and Testim.io.
There are two ways to integrate the capturing of HTML previews during automated UI tests:
(Recommended) Auto-capture via Rigi server. If you opt for this feature, your testing script can first call a small script that opens the Rigi project and prepares the application to capture previews in semi-automatic mode. When the unchanged script is executed, Rigi will automatically detect new strings and capture previews. In this case, developers only need to invoke a bootstrapper before the scripts are executed.
Capture previews using RigiJS.
You can invoke the
RIGI_SaveScreenshot
method in the Rigi.js script. In this case, the Rigi script must be injected into the window object after having loaded the web page. This approach requires extending the existing scripts with the call ofRIGI_SaveScreenshot
.Example 23.In the Cypress test automation framework, this could be done as follows:
You can also include the following line in the script:
RIGI_SaveScreenshot("acme.html")
. This will capture the HTML preview of the current page and save it asacme.html
. You can upload captured HTML previews to the Rigi server via API or import them via the UI (for details, see the Manage HTML previews guide).Some developer teams might be reluctant to extend these scripts. Contact the Rigi team for more information.