-
Notifications
You must be signed in to change notification settings - Fork 675
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
takeScreenshot ignores Path Pattern Placeholders #8086
Comments
Hello @vasilyevi, When you add a path in the Please refer to the following help topic: t.takeScreenshot Method |
I do understand that it overrides, but my need is to make a screenshot with a custom name, but save it exactly to the same folder. Is it supported? what's the reason if not? |
TestCafe does not support this functionality, and we cannot classify it as a bug. We can accept this ticket as an enhancement request. However, we cannot specify estimates for when this feature may be implemented. |
I definitely disagree, as one feature breaks the logic of another one. I surprised it wasn't reported previously. Anyway it's up to you |
<!-- Thank you for your contribution. Before making a PR, please read our contributing guidelines at https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution We recommend creating a *draft* PR, so that you can mark it as 'ready for review' when you are done. --> ## Purpose Add new a parameter pathPattern to takeScreenshot method. It allows the use of placeholders for specific takeScreenshot calls. ## Approach I added a new parameter pathPattern to TakeScreenshotCommand . In src/screenshots/capturer.js _capture method retrieve screenshotPath from pathPattern. Show warning if both path and pathPattern present. ## References close #8086 ## Pre-Merge TODO - [x] Write tests for your proposed changes - [x] Make sure that existing tests do not fail --------- Co-authored-by: aleks-pro <[email protected]> Co-authored-by: Gene <[email protected]> Co-authored-by: Bayheck <[email protected]>
Release v3.5.0-rc.1 addresses this. |
1 similar comment
Release v3.5.0-rc.1 addresses this. |
What is your Scenario?
Trying to specify name for the screenshot ad it ignores Path Pattern Placeholders specified in config file.
What is the Current behavior?
it ignores Path Pattern Placeholders specified in config file
What is the Expected behavior?
have to use Path Pattern Placeholders
What is the public URL of the test page? (attach your complete example)
N/A
What is your TestCafe test code?
await t.takeScreenshot("asd"); -> saves in ./artifacts/screenshots/asd.png
await t.takeScreenshot("${DATE}${TIME}/${TEST}/asd.png"); -> saves in ./artifacts/screenshots/${DATE}${TIME}/${TEST}/asd.png
Your complete configuration file
screenshots: {
path: "./artifacts/screenshots",
takeOnFails: true,
pathPattern: "${DATE}${TIME}/${TEST}/${FILE_INDEX}${QUARANTINE_ATTEMPT}.png",
thumbnails: false
},
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
N/A
TestCafe version
3.4.0
Node.js version
v18.17.0
Command-line arguments
npx testcafe
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
No response
The text was updated successfully, but these errors were encountered: