-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Bug description
We're using the library in OSS mode (using pageShots
) and noticed that the root-level threshold
parameter (described in the docs) seems to be ignored in the comparison.
Only the snapshot-specific threshold
seems to be getting into account:
{
threshold: 0.1, // this is never used
pageShots: [
{
threshold: undefined // this is used, if defined
...
}
}
Looking at the code seems to confirm this hypothesis: https://github.com/lost-pixel/lost-pixel/blob/main/src/checkDifferences.ts#L70-L71
How to reproduce
- Use lost-pixel v3.22.0
- Setup config with
pageShots
andgenerateOnly: true
- Don't set any threshold in the pageShots' snapshots
- Set a global threshold in the root of the config
- For the example use a page that would produce a
pixelDifferencePercentage
below the specified threshold but greater than 0 - Run
lost-pixel
with themeta
arg. - See in lost-pixel action logs--> {"pixelDifference":681,"pixelDifferencePercentage":0.0004926215277780001,"isWithinThreshold":false}
Expected behavior
isWithinThreshold
should be true
.
Lost Pixel information
lost-pixel logs from CI
No response
Metadata
Metadata
Assignees
Labels
No labels