You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How To Clear Output Folder That Saves The Failed Cases Snapshot #867
I am running my test cases on client server Via Jenkins and I want that each time when I Run my Tests then Output folder is cleaned and then when tests finishes all those failed cases snapshots are attached and sent in Build Report Email
What do you get instead?
Provide console output if related. Use --verbose mode for more details.
# paste output here
Provide test source code if related
// paste test
Details
CodeceptJS version:
NodeJS Version:
Operating System:
Protractor || WebDriverIO || Nightmare version (if related)
@DavertMik : Thanks for reply,I forgot to inform you that my Server is Windows 10 Machine,so request you to please tell me the command for windows that deletes all Sub Folders and Files Inside Output Directory .
Also please let me know that how this Output folder that contains snapshots ,will be attached in Build Report mail?
I am really sorry for Spamming twitter ,will not do it again.
I choose to rename the old output folder instead of deleting it, deleting it might require using glob or launching a sub-process that is aware of the OS.
OUTPUT_PATH is a variable defined on top of the configuration file, that is used both in this bootstrap function and in the output configuration. Not sure if there is a way to get the current configuration of Codecept as a parameter to the bootstrap function?
Activity
DavertMik commentedon Jan 11, 2018
This can be done with Jenkins without CodeceptJS
Just add
rm -rf tests/output/*before executing tests.And please don't spam in Twitter. That doesn't sound like a good manner.
ninpop25 commentedon Jan 12, 2018
@DavertMik : Thanks for reply,I forgot to inform you that my Server is Windows 10 Machine,so request you to please tell me the command for windows that deletes all Sub Folders and Files Inside Output Directory .
Also please let me know that how this Output folder that contains snapshots ,will be attached in Build Report mail?
I am really sorry for Spamming twitter ,will not do it again.
Thanks once again for quick response
schmkr commentedon Jan 2, 2019
FYI Here's an example on how I just set this up using the
bootstrapconfiguration:I choose to rename the old output folder instead of deleting it, deleting it might require using
globor launching a sub-process that is aware of the OS.OUTPUT_PATHis a variable defined on top of the configuration file, that is used both in this bootstrap function and in theoutputconfiguration. Not sure if there is a way to get the current configuration of Codecept as a parameter to the bootstrap function?schmkr commentedon Jan 2, 2019
🤔 Forget that, it seems doing this in the bootstrap function, the output dir is renamed during the run 😞
aesyondu commentedon Nov 27, 2020
Here is how I did it for 3.0.2, in case someone comes here from search engine: