testcafe
testcafe copied to clipboard
path pattern placeholder ${TEST} - cannot be applied to the recorded video.
What is your Scenario?
I want to create videos (or screenshot) where the filename will contain the testcase name. I create one js file for each test case.
I'm providing this config
"pathPattern": "${DATE}_${TIME}/${TEST}/${RUN_ID}/${USERAGENT}/${FILE_INDEX}.mp4"
What is the Current behavior?
This is the message I got
The "${TEST}" path pattern placeholder cannot be applied to the recorded video. The placeholder was replaced with an empty string.
file is pathname: C:\development\test-automation\end-to-end\artifacts\videos\2022-08-26_09-34-57\Chrome_104.0.5112.102_Windows_10\1.mp4
What is the Expected behavior?
C:\development\test-automation\end-to-end\artifacts\videos\2022-08-26_09-34-57\PPT-8309-Forn-PopupExport-campi\Chrome_104.0.5112.102_Windows_10\1.mp4
What is your public website URL? (or attach your complete example)
does not matter
What is your TestCafe test code?
does not matter
Your complete configuration file
{ "selectorTimeout":2000, "skipJsErrors":true, "screenshots":{ "takeOnFails":true }, "videoOptions":{ "singleFile":true, "failedOnly":false, "pathPattern": "${DATE}_${TIME}/${TEST}/${RUN_ID}/${USERAGENT}/${FILE_INDEX}.mp4" } }
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
use the provide config file, then run the test with option to record video
TestCafe version
1.20.0
Node.js version
v18.4.0
Command-line arguments
testcafe 'chrome --start-fullscreen' --video artifacts/videos --test-meta WKFSTATUS=ready,7.0=yes --cfg=at-7.0.json ./test/product-tree/PT.99.Framework/PT.99.03.Master-data/PT.99.03.Fornitori/System.Feature.Acceptance/PPT-8309-Forn-PopupExport-campi.js
Browser name(s) and version(s)
No response
Platform(s) and version(s)
windows 11
Other
No response
Hi @fmancardi,
This happens because you use the singleFile
option. In this case, all your tests are recorded in one file. Thus, we cannot determine what exact name that we should put in the pattern. That is why, you do not see the desired behavior, and you get a warning:
OK, thanks a lot, I'm sorry for the misundertanding
Confirmed, it worked with this .testcaferc.json -> "singleFile":false,
{
"selectorTimeout":2000,
"skipJsErrors":true,
"screenshots":{
"takeOnFails":true
},
"videoOptions":{
"singleFile":false,
"failedOnly":false,
"pathPattern": "${DATE}_${TIME}/${TEST}/${RUN_ID}/${USERAGENT}/${FILE_INDEX}.mp4"
}
}
I suggest to use a different (clearer IMHO) warning message like:
{$TEST} can not be used if you configure "singleFile":true,
Thank you for the suggestion. We will add warnings if singleFile
is true and will update this thread once this happens.
Thanks a lot!
Release v3.0.1-rc.1 addresses this.
Release v3.0.1 addresses this.