testcafe

In testcafe if we set disableScreenshots parameter to true than it ignores the t.screenshot() action and the takeOnFails parameter


if we set disableScreenshots parameter to true than it ignores the t.screenshot() action and the takeOnFails parameter. Is there a way we can only ignore t.screenshot() action but it should still get the screenshot of failer which generated by the takeOnFails parameter. currenltly if I am setting disableScreenshots parameter to true than it ignores the t.screenshot() action and the takeOnFails parameter.


Solution

  • You cannot prevent screenshots being taken only in the takeScreenshot action. According to the documentation, the --disable-screenshots option prevents TestCafe from taking screenshots whenever a test fails or a screenshot action is executed: https://testcafe.io/documentation/402840/guides/intermediate-guides/screenshots-and-videos#disable-screenshots