garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.78k stars 603 forks source link

fileNameTemplate - reason to have viewportIndex in the filename? #1345

Closed klodoma closed 3 years ago

klodoma commented 3 years ago

Just questioning the reason to have the viewportIndex in the filename by default.

The Problem I have is that if the viewports changing(order is changed or something new added in-between) then the whole references are invalid due to the viewportIndex.

https://github.com/garris/BackstopJS#changing-screenshot-filename-formats

  fileNameTemplate: '{scenarioIndex}_{scenarioLabel}_{selectorIndex}_{selectorLabel}_{viewportIndex}_{viewportLabel}',

image

garris commented 3 years ago

This is just an old convention to ensure that reports ordered results related to their positioning the config. With simple implementations (for most new users) this helps keep behavior predictable. More advanced users like yourself can simply remove that tag from the template to order things by viewport name.

klodoma commented 3 years ago

Thanks for the info. Kind of makes sense.

It's a matter of preference and it's configurable, so all good.