Search code examples
javascriptautomated-testsscreenshote2e-testingtestcafe

Saving a screen shot in ./ directory testcafe


I am running testcafe with the options --screenshots --screenshots-on-fails what I want it to do is save a screen shot in my current working directory but instead, it saves it in screenshots/${DATE}_${TIME}/....... is there a way to specify a file to put the screen shot in like

--screenshots -n "./foo.png" --screenshots-on-fails

Solution

  • TestCafe now supports screenshot path patterns.

    In TestCafe v1.5.0 and newer, use the pathPattern parameter.