Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestamp env variabile that can be used in the screenshot titles #8385

Closed
razvanvancea opened this issue Feb 25, 2025 · 3 comments
Closed
Labels
TYPE: enhancement The accepted proposal for future implementation.

Comments

@razvanvancea
Copy link

What is your Scenario?

Hello, using quarantineMode I would like to have a ${TIMESTAMP} variable that can be used in .testcaferc.js screenshots pathPattern so I can save a screenshots of the failed test for each test retry. Otherwise in the current approach the screenshots will have the same name and will be overwritten.

e.g. pathPattern: '${DATE}${TIME}${TIMESTAMP}/${TEST}.png' // the TIMESTAMP/other unique dynamic identifier does not work

What are you suggesting?

pathPattern: '${DATE}${TIME}${TIMESTAMP}/${TEST}.png' // the TIMESTAMP/other unique dynamic identifier does not work

What alternatives have you considered?

No response

Additional context

No response

@razvanvancea razvanvancea added the TYPE: enhancement The accepted proposal for future implementation. label Feb 25, 2025
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 25, 2025
@razvanvancea
Copy link
Author

someScreenshotTitle.png already exists. It has just been rewritten with a recent screenshot. This situation can possibly cause issues.

@testcafe-need-response-bot testcafe-need-response-bot bot removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 28, 2025
@aleks-pro
Copy link
Contributor

Hello @razvanvancea ,

Please use ${QUARANTINE_ATTEMPT} or ${RUN_ID} placeholders. They will add an attempt number to a screenshot file name during test runs. You can use them in the following way:
pathPattern: '${DATE}${TIME}_${TEST}_${QUARANTINE_ATTEMPT}.png'

For more information, refer to the following help: Path pattern placeholders.

Let me know if this helps.

@aleks-pro aleks-pro added the STATE: Need clarification An issue lacks information for further research. label Feb 28, 2025
@razvanvancea
Copy link
Author

@aleks-pro I confirm this approach solves my issue. It might worth having these 2 variables mentioned in the official documentation. Thank you!

@testcafe-need-response-bot testcafe-need-response-bot bot added STATE: Need response An issue that requires a response or attention from the team. and removed STATE: Need response An issue that requires a response or attention from the team. labels Feb 28, 2025
@github-actions github-actions bot removed the STATE: Need clarification An issue lacks information for further research. label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

2 participants