Filename limitation in cy.screenshot #3052
Labels
pkg/server
This is due to an issue in the packages/server directory
type: unexpected behavior
User expected result, but got another
Milestone
Description:
I was wondering if Cypress could allow CJK's characters in a filename when we call cy.screenshot() or cy.screenshot(filename).
As the definition of source code screenshots.coffee (if this is the right place?), the valid characters in a filename seems like
Besides the valid characters, all the other characters in a filename will replace to "".
We wrote Chinese description for each test run, for we can generate Chinese report. This cause problems when we use default naming convention
cy.screenshot()
, or even worse,cy.screenshot(Chinese_Filename)
, as described below.Current behavior:
Desired behavior:
Something I have tried
Listen the event
after:screenshot
, and then, I can move the created image to the correct place with correct filename.Cypress.Screenshot.defaults({onAfterScreenshot ($el, props) {},})
can do the same job too. However, it will lose the information corresponding to test run's description in the above manner. This is not working if I take screenshot via default naming rulecy.screenshot()
. I think this is just a workaround.Is it possible to only discard the special characters in a filename without losing CJK's characters? Though, this would become not fully portable filenames, but it become more convenience for non-english users.
Versions
Cypress 3.1.2
MacOS 10.13.4
Chrome 71.0.3578.98
The text was updated successfully, but these errors were encountered: