I would like to know how to properly configure TestCafe to save artifacts so that if somethings fails in CI, it would be easier to troubleshoot.
Our tests are triggered in CI/CD (inside docker container) each time a developer commits to their feature branch. Running tests locally, videos and screenshots are saved to testcafe/artifacs/* respectively in case of a failure. Tested that if a testcase does fail, it shows like it saved the screenshot, but in the end it doesn't save it.
Screenshot:
/builds/projectX/projectX/testcafe/artifacts/screenshots/2021-05-10_10-58-43/test-15/Chrome_89.0.4389.90_Linux_0.0/errors/1.png
Snippet from .testcaferc.json:
"screenshots": {
"path": "artifacts/screenshots",
"takeOnFails": true,
"fullPage": true
},
"videoPath": "artifacts/videos",
"videoOptions": {
"failedOnly": true
},
From .gitlab-ci.yml:
artifacts:
paths:
- testcafe/artifacts/