Skip to main content

Html-Reporter Commands

Overview

The html-reporter plugin adds the following commands to Testplane:

  • gui—to run Testplane in GUI mode;
  • remove-unused-screens—to remove reference screenshots that are not used in tests;
  • merge-reports—to merge Testplane's separate reports into one general report.

gui

Use the gui command to launch Testplane in GUI mode.

GUI mode allows you to:

  • run tests interactively;
  • update screenshots—visually viewing them and taking only the necessary diffs;
  • reuse reports from CI;
  • filter the results of the run by errors, keys from meta, etc.

Usage

npx testplane gui

remove-unused-screens

Use the remove-unused-screens command to remove the reference screenshots that are not used in tests.

How does it work?

First, the command looks for screenshots for which there are no tests on the file system.

Next, the command searches for screenshots that were not used in successful testing (the test result is taken from the SQLite database). To do this, the html-report must exist on the file system and contain the results of the tests run. This means that you must run the tests locally or download the report from CI before running the remove-unused-screens command.

Usage

The remove-unused-screens command supports several options:

OptionDescription
-p, --pattern <pattern>A pattern for finding screenshots on the file system.
--skip-questionsDo not ask questions during execution (use default values).
-h, --helpOutput the reference information on the command to the terminal.

Usage examples

Specifying the folder in which to search for unused screenshots:

npx testplane remove-unused-screens -p 'testplane-screens-folder'

Setting the pattern by which to search for screenshots:

npx testplane remove-unused-screens -p 'screens/**/*.png'

Setting several patterns by which to search for screenshots:

npx testplane remove-unused-screens -p 'screens/**/chrome/*.png' -p 'screens/**/firefox/*.png'

Specifying the folder in which to search for unused screenshots and setting do-not-ask-questions option:

npx testplane remove-unused-screens -p 'testplane-screens-folder' --skip-questions

Getting the reference information about the command:

npx testplane remove-unused-screens --help

merge-reports

Use the merge-reports command to merge Testplane's separate reports into one general report.

The command accepts paths to database files or to databaseUrls.json files from other html-reports. It creates a new html-report in the destination folder with a single file databaseUrls.json, which will contain a link to the database file or to the files databaseUrls.json from the input parameters. Database files are not copied to the destination folder at the same time.

Usage

The merge-reports command supports the following required option:

OptionDescription
-d, --destination <folder>The path to the folder where you want to save the final report.

Usage example:

npx testplane merge-reports path-to-database.db path-to-databaseUrls.json -d dest-report