Skip to content

TEST.autoScreenshot

TEST.autoScreenshot is a configuration property that controls whether screenshots are automatically taken with every test command.

When enabled, UI-licious captures a screenshot at each step of the test and attaches it to the test report.

The screenshot is captured at the end of the step for most commands. The only exception is the I.click() command, which captures the screenshot before the click is performed, so that the click target can be highlighted in the test report.

The configuration can be changed at any point during the test. It can be useful to disable screenshots in situations where sensitive information is shown on screen.

Usage

js
TEST.autoScreenshot = true // enable automatic screenshots
TEST.autoScreenshot = false // disable automatic screenshots

Example

js
I.click("Generate API key")

// disable screenshots 
TEST.autoScreenshot = false
I.click("Copy secret")
I.click("Next")

// re-enable screenshots
TEST.autoScreenshot = true

In the example above, screenshots are disabled while sensitive information is shown on screen, and then re-enabled afterward.