Skip to content

Add visual regression testing with swift-snapshot-testing#70

Merged
kmatzen merged 8 commits intomainfrom
feat/visual-regression-testing
Feb 22, 2026
Merged

Add visual regression testing with swift-snapshot-testing#70
kmatzen merged 8 commits intomainfrom
feat/visual-regression-testing

Conversation

@kmatzen
Copy link
Copy Markdown
Owner

@kmatzen kmatzen commented Feb 22, 2026

Summary

  • Integrates Point-Free swift-snapshot-testing (1.15.4) into the FacettUITests target
  • Each screenshot test now asserts the captured image against a committed reference with 99.5% pixel / 98% perceptual precision tolerance
  • Reference images for all 4 current screenshots are committed under FacettUITests/__Snapshots__/
  • CI workflow updated to fail on visual regressions and upload diff artifacts for review

How to update references

After intentional UI changes, set isRecording = true in SnapshotTests.setUp(), run the tests locally, then commit the updated reference images.

Test plan

  • xcodebuild test passes locally against committed references
  • Build succeeds with swift-snapshot-testing 1.15.4 linked to FacettUITests
  • CI workflow runs and passes on push

Made with Cursor

Base automatically changed from chore/app-store-prep to main February 22, 2026 05:50
@kmatzen kmatzen force-pushed the feat/visual-regression-testing branch 2 times, most recently from 2831b91 to e6fd146 Compare February 22, 2026 18:27
Kevin Blackburn-Matzen and others added 5 commits February 22, 2026 11:46
Integrates Point-Free's swift-snapshot-testing (1.15.4) into the UI test
target to catch unintended visual changes. Each screenshot test now asserts
against committed reference images with 99.5% pixel / 98% perceptual
precision tolerance. Reference images for all 4 current screenshots are
included.

To update references after intentional UI changes: set isRecording = true
in setUp(), run the tests, then commit the updated images.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove || true from xcodebuild test step so snapshot mismatches
cause the workflow to fail. Failure diffs are uploaded as artifacts
for review.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add 7 new screenshot tests (05-11) covering camera details, config
editing, camera group editing, add camera, add group, voice
notifications, and QR codes. The QR code screenshot uses fastlane-only
capture since its timecode content changes every frame.

Supporting changes:
- Add accessibility labels for Group Actions and Config Actions menus
- Add accessibility identifier for AddCameraButton
- Fix camera details sheet to use .sheet(item:) for reliable binding
- Remove unnecessary NavigationStack wrapper from ContentView
- Add discovered cameras to demo data for Add Camera screenshot
- Guard BLEManager.refreshDiscoveredCameras() in demo mode

Co-authored-by: Cursor <cursoragent@cursor.com>
The macos-15 runner doesn't have the iOS 18.2 simulator runtime that
Xcode 16.2 expects. Select the newest available Xcode and target
OS=latest to match whatever simulator runtimes are installed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate all reference images against current UI. Fix background
assertion timeouts in testAddCameraScreenshot and
testAddCameraGroupScreenshot by using guard/return with longer waits
instead of nested if blocks.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kmatzen kmatzen force-pushed the feat/visual-regression-testing branch from e6fd146 to 6bca7a7 Compare February 22, 2026 19:56
Kevin Blackburn-Matzen and others added 3 commits February 22, 2026 12:16
Reference images are generated locally but CI runs on a different
Xcode/iOS version. Relax thresholds from 99.5%/98% to 90%/85% to
tolerate font rendering and antialiasing differences while still
catching actual UI regressions. Also add SNAPSHOT_RECORD env var
support and increase CI timeout to 30 minutes.

Co-authored-by: Cursor <cursoragent@cursor.com>
The macos-15 runner updated to Xcode 26.3 which may not have an iOS
runtime matching "OS=latest" for iPhone 16 Pro Max. Drop the OS
constraint and add simulator listing for debugging.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove swift-snapshot-testing dependency, CI screenshot workflow, and
reference images. Screenshot tests now just use fastlane snapshot()
for local App Store screenshot generation without cross-environment
visual regression comparison that was unreliable and slow on CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kmatzen kmatzen merged commit c054c3b into main Feb 22, 2026
1 check passed
@kmatzen kmatzen mentioned this pull request Feb 22, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant