-
Notifications
You must be signed in to change notification settings - Fork 669
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
Place named-screenshots under the relevant test screenshots folder rather than the screenshots root #1974
Comments
Hi @adrianaisemberg, we are working out a way to enable more flexible screenshots path, but now you can use the following approach as a workaround: import { ClientFunction } from 'testcafe';
import { parse } from 'useragent';
fixture `Take a screenshot`
.page `example.com`;
const getUserAgent = ClientFunction(() => navigator.userAgent.toString());
test('Take a screenshot with a custom path', async t => {
const ua = await getUserAgent();
const parsedUA = parse(ua);
await t.takeScreenshot('custom/' + parsedUA.family + '.png');
}); It will save screenshots to files according to browser names, e.g. |
closed in favor of #2152 |
* Screenshot file pattern * refactor test constrants * small refactoring * renames * don't correct file path for custom file path * try to fix tests2 * revert back correct file path for custom path * revert dedent module * fix review issues
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow. |
Are you requesting a feature or reporting a bug?
Bug
What is the current behavior?
Taking named screenshots saves them under the screenshots root.
Compared to taking unnamed screenshots which saves those under the currently running test folder.
What is the expected behavior?
Save named screenshots to the same place as the unnamed (indexed) ones, or at least under a sibling folder.
How would you reproduce the current behavior (if this is a bug)?
t.takeScreenshot("after-click")
This is a result of the second test screenshot overwriting the first's.
This raises several concerns:
Provide the test code and the tested page URL (if applicable)
Tested page URL:
Test code
Specify your
The text was updated successfully, but these errors were encountered: