-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
retain html report #3309
retain html report #3309
Conversation
lib/settings/defaults.js
Outdated
// HTML report options that will be use by html report | ||
html_reporter: { | ||
// retain html report across test runs | ||
retain_report: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a flag? What would be the best scenario is that we append the timestamp in the index.html
file which will be unique, as well as let us know which file has the latest report
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't change index.html
as it would be used in different CI pipelines to host the HTML page. In future we would need to maintain a single index.html containing all the results from previous test runs. We need a flag to preserve the default behavior and not create breaking changes for those using HTML reporter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need a flag. The user can just define a folder_format
function that will be undefined
by default, in which case the current behaviour stays.
We should probably use reporter
as the settings name, because we might have other options there. We can also in the future move the output_folder
setting in it and have something like:
reporter: {
output_folder: '',
folder_format: function() {}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or it can be a function that returns the default value, as you've implemented here.
lib/settings/defaults.js
Outdated
|
||
return `${fileName.join('/')}${isError ? '_ERROR' : '_FAILED'}_${dateStamp}.png`; | ||
}; | ||
|
||
const folder_format = function({failed, errors, dateObject = new Date()} = {}) { | ||
const dateStamp = getDateStamp(dateObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have this as prefix, as it will make it harder to sort the report folder names.
default output_folder would is now moved inside If // nightwatch.conf.js
{
reporter_options: {
output_folder: 'test_outputs',
folder_format: () => Date.now()
}
} |
Changes
retain_report
is set to trueImpacts