mardi 27 octobre 2020

Is it possible to take screenshots at arbitrary moment and also keep the takeonfail value as true in testcafe

at present I am not able to figure out the screenshot functionality of testcafe. I want to take screenshots at arbitrary moments in my testcase but I also want to keep the takeonfails option as true in the testcafe configuration file. But whenever I do so the test case only takes screenshots when the test fails. For successfull runs I cannot find any screenshot. If I remove the takeOnFails option from configuration file then I get screenshots for passed test cases

This is how the screenshot section looks in the testcafe configuration file "screenshots": { "path": "./screenshots", "takeOnFails": true, "pathPattern": "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png", "fullPage": true } And I using await t.takeScreenshot() in the test case to take screenshots at arbitrary places.

Could some please help and suggest me on how I can take screenshots for both passed and failed test cases

Aucun commentaire:

Enregistrer un commentaire