.
$ react-native -v
react-native-cli: 2.0.1
$ react-native init NativeSnapshots
$ cd NativeSnapshots
$ react-native run-ios
, .
$ cd ios
$ fastlane snapshot init
Fastlane:
[14:37:56]: For more information, check out https://docs.fastlane.tools/getting-started/ios/setup/
✅ Successfully created SnapshotHelper.swift './SnapshotHelper.swift'
✅ Successfully created new Snapfile at './Snapfile'
Open your Xcode project and make sure to do the following:
1) Add a new UI Test target to your project
2) Add the ./fastlane/SnapshotHelper.swift to your UI Test target
You can move the file anywhere you want
3) Call `setupSnapshot(app)` when launching your app
let app = XCUIApplication()
setupSnapshot(app)
app.launch()
4) Add `snapshot("0Launch")` to wherever you want to create the screenshots
More information on GitHub: https://github.com/fastlane/fastlane/tree/master/snapshot
1:
Xcode Version 8.3.3 > NativeSnapshots.xcodeproj
File > New > Target > iOS UI Testing Bundle
2: . /fastlane/SnapshotHelper.swift
Highlight NativeSnapshotsUITests
File > Add Files to NativeSnapshots
Select ./fastlane/SnapshotHelper.swift, Enter
3: setupSnapshot ()
NativeSnapshotsUITests/NativeSnapshotsUITests.swift
Xcode.
:
XCUIApplication().launch()
let app = XCUIApplication()
setupSnapshot(app)
app.launch()
4: snapshot("0Launch")
,
testExample() .
func testExample() {
snapshot("0Launch")
}
Edit the Snapfile to avoid the huge matrix.
devices([
"iPhone 6"
])
languages([
"en-US"
])
scheme "NativeSnapshots"
He must be ready for work.
$ cd ios && fastlane snapshot
Copied from aj0strow
source
share