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

Support screenshot path pattern #2152

Closed
AlexanderMoskovkin opened this issue Feb 20, 2018 · 2 comments · May be fixed by marcusrc/testcafe#1
Closed

Support screenshot path pattern #2152

AlexanderMoskovkin opened this issue Feb 20, 2018 · 2 comments · May be fixed by marcusrc/testcafe#1
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

Proposal

related issues: #1602, #1651, #1974, #1975.
related PR: #2086

What

Provide a capability to set a pattern for a screenshot path.

API

  • CLI API:
-p or --screenshot-path-pattern

testcafe chrome test.js -s <path> -p "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png"

Available options:
- ${DATE}
- ${TIME}
- ${TEST_INDEX}
- ${FILE_INDEX}
- ${QUARANTINE_ATTEMPT} --by default "1" (if you add it to the template but run tests without the `-q` option).

- ${FIXTURE}
- ${TEST}
- ${USERAGENT}
- ${BROWSER}
- ${BROWSER_VERSION}
- ${OS}
- ${OS_VERSION}

If TestCafe creates a screenshot when a test fails (--screenshots-on-fails option enabled) we just add the -error postfix to the filename.

  • Programming API:
runner.screenshot(path [, takeOnFails][, filePath])
// where filePath is a template string or a function that take the info and returns a value
  • t.takeScreenshot, t.takeElementScreenshot
    Should support file path pattern as well.
@miherlosev
Copy link
Collaborator

Implemented in #2562

@lock
Copy link

lock bot commented Mar 28, 2019

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.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants