-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Ability to set screenshot filename formats for screenshots generated by on_failure and on_error - take 2 #2023
Comments
The default shouldn't change. I think we could add the option to specify a function that would take the filename, date and any other relevant stuff as arguments and use the return value. |
Yeah, I thought of that, but I dismissed it because I mistakenly thought that the Your suggestion is much better. The default value being a function that returns exactly the current file names. |
I would like to hard-code the name so it overwrites the last one every time for the reason that I want to insert the screenshot on fail into the report html via 64 bit encoding. |
I need this too, as I get fail I don't know under which browser the test failed. |
quick workaround - define folder "screens" in NW config as e.g. screens_firefox (do it per browser config), at least screens will be separated by folder names. I stopped counting on any improvement and fixes. |
+1 for adding this feature. The current default file name is really ugly ...
... and we need a way to set our own file name. |
This is a dup of #1620. However #1620 was closed by the stale bot and I can't reopen it. The issue still has merit so I (re-)submit the issue.
For our purposes, we'd just like the file names easily parsable and since the terminal's
ls -l
sorts by filename by default, make sure the filenames start with the year, month, day, hour etc.Currently, lib/testsuite/screenshots.js:18 has:
And so nothing is configurable. It seems it wouldn't be so hard to refactor this to take a screenshots object where a format is configurable.
Patches are welcome, I'm guessing.
I'd change the third parameter, screenshotsPath (which comes from
this.settings.screenshots.path
) to takethis.settings.screenshots
instead and fix all the places that call it (recursively) and then document the newfilename_format
in a similar commit in nightwatch-docs's gettingstarted/configuration/config-test-settings.mdI'd let
filename_format
default to the current format with%T_%S
where:%T: Textual description
%S: Date string like
Sep-29-2017-160341-GMT+0200
%I: Date string in ISO 8601 Notation like:
2008-09-15T15:53:00+05:00
That way we could configure
file_format: '%I_%T'
and get what we want without messing with the default. (Or perhaps the default should change?)Are there other considerations to be taken into account? Anything preventing such a PR from being considered?
The text was updated successfully, but these errors were encountered: