Rename snapshots (#4756)
* renaming snapshots so that it's easier to diff them when an upgrade happens. * fix macOS runner version for the compound tests * os version update in the yml * possible fix to run compound-ios tests
This commit is contained in:
@@ -35,11 +35,11 @@ enum Application {
|
||||
private static func checkEnvironments() {
|
||||
let requirediPhoneSimulator = "iPhone18,3" // iPhone 17
|
||||
let requirediPadSimulator = "iPad15,7" // iPad (A16)
|
||||
let requiredOSVersion = 26
|
||||
let requiredOSVersion = (major: 26, minor: 1)
|
||||
|
||||
let osVersion = ProcessInfo().operatingSystemVersion
|
||||
guard osVersion.majorVersion == requiredOSVersion else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||
guard osVersion.majorVersion == requiredOSVersion.major, osVersion.minorVersion == requiredOSVersion.minor else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion.major).\(requiredOSVersion.minor) for these tests.")
|
||||
}
|
||||
|
||||
guard let deviceModel = ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] else {
|
||||
@@ -48,9 +48,6 @@ enum Application {
|
||||
guard deviceModel == requirediPhoneSimulator || deviceModel == requirediPadSimulator else {
|
||||
fatalError("Running on \(deviceModel) but we only support \(requirediPhoneSimulator) and \(requirediPadSimulator).")
|
||||
}
|
||||
guard UIDevice.current.snapshotName == "iPhone-26.1" || UIDevice.current.snapshotName == "iPad-26.1" else {
|
||||
fatalError("Running on a simulator that hasn't been renamed to match the expected snapshot filenames.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +89,11 @@ extension XCUIApplication {
|
||||
}
|
||||
|
||||
private var deviceName: String {
|
||||
UIDevice.current.snapshotName
|
||||
switch UIDevice.current.userInterfaceIdiom {
|
||||
case .pad: return "iPad"
|
||||
case .phone: return "iPhone"
|
||||
default: fatalError("Unsupported device type: \(UIDevice.current.userInterfaceIdiom)")
|
||||
}
|
||||
}
|
||||
|
||||
private var localeCode: String {
|
||||
@@ -111,20 +112,6 @@ extension XCUIApplication {
|
||||
}
|
||||
}
|
||||
|
||||
private extension UIDevice {
|
||||
var snapshotName: String {
|
||||
var name = name
|
||||
|
||||
// When running with parallel execution simulators are named "Clone 2 of iPhone 14" etc.
|
||||
// Tidy this prefix out of the name to generate snapshots with the correct name.
|
||||
if name.starts(with: "Clone "), let range = name.range(of: " of ") {
|
||||
name = String(name[range.upperBound...])
|
||||
}
|
||||
|
||||
return name
|
||||
}
|
||||
}
|
||||
|
||||
private extension UIImage {
|
||||
/// Adjusts the image by cropping it with the given edge insets.
|
||||
func inset(by insets: UIEdgeInsets) -> UIImage {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9e8fbd4fa17c81da4aa851129f86614ba55049dc231e2867bf5781a244b6325b
|
||||
size 191765
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user