Skip to content

Renaming snapshots without or with visual changes (target snapshot name) #1347

@user4i

Description

@user4i

General info

It would be great to be able to rename snapshots. And keep visual comparing at same build.

If no such option, we would be thankful if you can add it.

Possible solution

Special option target-name to Per-snapshot configuration could be added. So Percy will compare snapshot like it name was not changed with snapshot from baseline named target-name , but new name will be name.

percySnapshot('New name', {
    'target-name': 'Previous snapshot name', // Name in baseline
    ...otherOPTIONS
})

Reasons

Sometimes we would like to change global approach of snapshots renaming. Renaming one or group of e.g. 100 snapshots together. But be sure in same time, that not visual changes in renamed future baseline.

E.g.:

  • Previous snapshot name Main page - nav bar,
  • We would add height suffix, so new name would be Main page - Nav bar - h1024
  • Or we would like to group all Site snapshots, for good logical separation from snapshots for Admin part, so new name will be Site - Main page - Nav bar - h1024
  • Such renaming can be global, as general approach to naming big group of files. E.g. 100 snapshots.
  • But if no visual changes during such renaming, so we miss and break approved baseline in history because of renaming. And missing of baseline could be for a big group of snapshots.
  • Or even some visual changes could be for some screenshots. But Percy can show changes by comparation with baseline (by previous name).

This would be reasonable addition for flexible handling of technical changes together with next environment variables:

  • PERCY_BRANCH
  • PERCY_TARGET_BRANCH
  • PERCY_COMMIT
  • PERCY_TARGET_COMMIT

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions