Skip to content

iOS 17 Snapshots have weird edges and radius #790

@davidalhambra

Description

@davidalhambra

Describe the bug
When I run my tests on iOS17 I get different version than the previous versions. It's weir because the components itself doesn't change visually on my app, only in the snapshots. It happens with some components that have radius or curved edges.
This is happening for UIKit and SwiftUI components. They also have different approaches. In the screenshot we see an screenshot of one Capsule SwiftUI item, but is happening the same with an UIKit item built with a background color and shaped.

To Reproduce
This is the body of the Capsule item of the screenshot bellow.

        public var body: some View {
            /// We do not use Apples formatted API because we want a small badge
            /// without a space between number and % - also this code looks simpler.
            Text(String(format: "%.0f%%", progress))
                .padding(.horizontal, Style.horizontalPadding)
                .frame(height: Style.height)
                .background(
                    Capsule()
                        .fill(Style.background(for: progress).color,
                              strokeBorder: Style.border.color,
                              lineWidth: Style.borderWidth)
                )
        }

Expected behavior
On previous iOS versions we had a clear Snapshot with the Capsule or Circle shape. Right now we get the good shape on the app (nothing changed) but not at the Snapshot.

Screenshots
test_SwiftUI_ProgressBadge_ColorSchemes light

Captura de pantalla 2023-10-11 a las 14 27 08

Environment

  • swift-snapshot-testing version [e.g. 1.9.0]
  • Xcode 15.0
  • Swift 5
  • OS: iOS 17

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