Skip to content

Snapshot images vary by location #977

@ynieSalesforce

Description

@ynieSalesforce

Describe the bug
We have two teams located in the US and Hyderabad, India. Our team in India is encountering issues when capturing snapshot images, which differ from those generated by the US team.

Both teams are using MacBook Pros with the M3 chip, region and language settings are set to en-US, and there have been no changes to simulator accessibility settings.

Please refer to the attached images for comparison. Specifically, we’re noticing that multi-line text fields (in both UIKit and SwiftUI) appear to have increased spacing between lines in the snapshots from the India team.

To Reproduce

struct TestView: View {
  var body: some View {
    VStack {
      Text("Hello, World!, this is a test view, this has very long text, test, test, test, this is a test view, this has very long text, test, test, test")
        .font(.body)

      Spacer()
    }
  }
}

class TestViewSnapshotTests: TrailheadBaseTests {
  func testViewLoads() {
    assertSnapshot(
      of: UIHostingController(rootView: TestView()),
      as: .image(on: .iPhoneSe(.portrait), precision: 0.98, perceptualPrecision: 0.98),
      record: false
    )
  }
}

Expected behavior
Snapshots should match

Screenshots
Image
Left snapshot is from US, and right is from India.

Environment

  • swift-snapshot-testing version - 1.18.3
  • Xcode - 16.1
  • Swift - 5
  • OS: 18.1 (iPhone SE simulator )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions