Patch Changes
-
a3bc7a4: ## #1115 Respect
alwaysSaveActualImage: falseforcheckScreenmethodsWhen using visual matchers like
toMatchScreenSnapshot('tag', 0.9)withalwaysSaveActualImage: false, the actual image was still being saved even when the comparison passed within the threshold.The root cause was that the matcher's expected threshold was not being passed to the core comparison logic. The core used
saveAboveTolerance(defaulting to 0) to decide whether to save images, while the matcher used the user-provided threshold to determine pass/fail - these were disconnected.This fix ensures:
- When
alwaysSaveActualImage: falseandsaveAboveToleranceis not explicitly set, actual images are never saved (respecting the literal meaning of the option) - When
saveAboveToleranceis explicitly set (like matchers do internally), actual images are saved only when the mismatch exceeds that threshold
Committers: 1
- Wim Selles (@wswebcreation)
- When
-
a3bc7a4: ## Fix:
save*methods now always save files regardless ofalwaysSaveActualImagesettingPreviously, when
alwaysSaveActualImage: falsewas set in the configuration,save*methods (saveScreen,saveElement,saveFullPageScreen,saveAppScreen,saveAppElement) were not saving files to disk, causing test failures.The
alwaysSaveActualImageoption is intended to control whether actual images are saved duringcheck*methods (comparison operations), notsave*methods. Sincesave*methods are explicitly designed to save screenshots, they should always save files regardless of this setting.This fix ensures:
save*methods always save files to disk, even whenalwaysSaveActualImage: falseis set in the configalwaysSaveActualImage: falsecontinues to work correctly forcheck*methods (as intended for issue #1115)- The behavior is now consistent:
save*= always save,check*= respectalwaysSaveActualImagesetting
Implementation details:
- The visual service overrides
alwaysSaveActualImage: truewhen callingsave*methods directly from the browser API save*methods respect whateveralwaysSaveActualImagevalue is passed to them (no special logic needed)check*methods pass through the config value (which may befalse), sosave*methods respect it when called internally- This clean separation ensures
save*methods work correctly when called directly while still respectingalwaysSaveActualImageforcheck*methods
Committers: 1
- Wim Selles (@wswebcreation)