Snap.swift: 基于快照的UI测试框架

Snap.swift 是一款用于简化视图 UI 测试的快照测试库。它要求 iOS 9.0+、tvOS 10.0+、Xcode 9.0+ 以及 Swift/Objective-C 环境。

UI 测试的目的是确保每次与 UI 元素交互时,界面都能保持预期状态。这种集成测试有助于实现像素级完美的视图,并通过设计参考图像满足设计师的需求。

Snap.swift 的工作原理是生成一个存储在代码库中的参考图像,然后将每个新的测试用例与该参考图像进行比较,以检查是否存在差异。如果测试发现任何差异,则测试失败。

zip
Snap_swift-develop.zip 预估大小:91个文件
folder
Snap.swift-develop 文件夹
file
.gitignore 9B
file
Cartfile.private 105B
file
.swiftlint.yml 200B
folder
.art 文件夹
file
header.sketch 48KB
file
header.png 29KB
file
xcode_project_environment_variable.png 94KB
file
xcode_attachment.png 99KB
file
.travis.yml 287B
folder
SnapTests 文件夹
file
SnapTests.swift 3KB
folder
Resources 文件夹
folder
Extension 文件夹
folder
XCTestCase 文件夹
file
XCTestCase+CustomAsserts.swift 428B
folder
Image 文件夹
file
Image.swift 370B
folder
Assets.xcassets 文件夹
folder
tick.imageset 文件夹
file
Contents.json 301B
file
tick.png 1KB
folder
camera.imageset 文件夹
file
Contents.json 303B
file
camera.png 1KB
file
Contents.json 62B
folder
tick_modified.imageset 文件夹
file
tick_modified.png 1KB
file
Contents.json 310B
file
Info.plist 701B
folder
Snap 文件夹
folder
SnapTests 文件夹
file
reference_test_box_with_background_color@2x.png 2KB
file
reference_iphone8_test_box_with_iphone_device_configurations@2x.png 22KB
file
reference_ipadmini_test_box_with_all_device_configurations@2x.png 65KB
file
reference_iphone8plus_test_box_with_all_device_configurations@2x.png 27KB
file
reference_ipadpro129_test_box_with_ipad_device_configurations@2x.png 114KB
file
reference_ipadpro129_test_box_with_all_device_configurations@2x.png 114KB
file
reference_ipadpro105_test_box_with_all_device_configurations@2x.png 76KB
file
reference_iphonex_test_box_with_all_device_configurations@2x.png 28KB
file
reference_test_scenekit_view@2x.png 4KB
file
reference_ipadpro105_test_box_with_ipad_device_configurations@2x.png 76KB
file
reference_iphone8plus_test_box_with_iphone_device_configurations@2x.png 26KB
file
reference_yellow_box@2x.png 2KB
file
reference_ipadmini_test_box_with_ipad_device_configurations@2x.png 65KB
file
reference_test_box_with_text_aligned_to_center@2x.png 4KB
file
reference_iphonex_test_box_with_iphone_device_configurations@2x.png 26KB
file
reference_test_box_with_gradient_layer@2x.png 3KB
file
reference_iphone8_test_box_with_all_device_configurations@2x.png 23KB
file
reference_test_spritekit_view@2x.png 2KB
file
reference_ipadair_test_box_with_ipad_device_configurations@2x.png 67KB
file
reference_iphone5_test_box_with_iphone_device_configurations@2x.png 16KB
file
reference_iphone5_test_box_with_all_device_configurations@2x.png 17KB
file
reference_ipadair_test_box_with_all_device_configurations@2x.png 67KB
folder
Core 文件夹
folder
Infrastructure 文件夹
folder
Extension 文件夹
folder
UIImage 文件夹
file
UIImageNormalizedSpec.swift 244B
file
UIImageCompareSpec.swift 2KB
folder
CALayer 文件夹
file
CALayerImageSpec.swift 971B
folder
Domain 文件夹
folder
Model 文件夹
file
TestTargetSpec.swift 4KB
folder
Test Doubles 文件夹
file
EnvironmentStub.swift 163B
file
LICENSE 1KB
file
.swift-version 4B
folder
Snap.xcodeproj 文件夹
folder
xcshareddata 文件夹
folder
xcschemes 文件夹
file
SnapTests.xcscheme 2KB
file
Snap.xcscheme 4KB
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 149B
file
project.pbxproj 49KB
file
README.md 6KB
file
Cartfile.resolved 173B
folder
Snap 文件夹
file
Snap.h 119B
file
Info.plist 774B
folder
Core 文件夹
folder
Infrastructure 文件夹
folder
Utils 文件夹
folder
Environment 文件夹
file
Environment.swift 81B
file
ApplicationEnvironment.swift 164B
folder
Path 文件夹
file
Path.swift 93B
folder
Extension 文件夹
folder
UIImage 文件夹
file
UIImage+Diff.swift 1KB
file
UIImage+Normalized.swift 485B
file
UIImage+Compare.swift 3KB
file
UIImage+Context.swift 551B
folder
UIView 文件夹
file
UIView+Render.swift 2KB
folder
CALayer 文件夹
file
CALayer+Image.swift 388B
folder
Device 文件夹
file
Device+Size.swift 571B
file
AllDevices+All.swift 367B
folder
Interoperability 文件夹
file
Snap.h 776B
file
Interoperability.swift 700B
folder
Assembly 文件夹
file
Assembly+Utils.swift 219B
file
Assembly+Actions.swift 705B
file
Assembly+Matchers.swift 752B
file
Assembly.swift 142B
folder
Domain 文件夹
folder
Model 文件夹
file
Reference.swift 77B
file
TestTarget+Reference.swift 2KB
file
TestTarget.swift 771B
file
Device.swift 540B
folder
Application 文件夹
folder
Expectation 文件夹
file
SnapshotViewExpectation.swift 646B
file
SnapshotLayerExpectation.swift 444B
folder
Recordable 文件夹
file
Recordable+XCTestCase.swift 365B
file
Recordable.swift 82B
folder
Actions 文件夹
file
AddAttachment.swift 549B
file
SaveImageToDisk.swift 814B
file
ExtractViewImage.swift 844B
file
CompareImages.swift 3KB
folder
Matcher 文件夹
file
SnapshotViewMatcher.swift 2KB
file
Matcher.swift 559B
file
SnapshotLayerMatcher.swift 1011B
folder
Snap 文件夹
file
Snap.swift 265B
file
Snap.swift.podspec 859B
folder
.scripts 文件夹
file
install-swiftlint.sh 732B
...
zip 文件大小:306.72KB