TOBQTIPUJOJU
$ snapshot init
Successfully created SnapshotHelper.js './SnapshotHelper.swift'
Successfully created new Snapfile at './Snapfile'
-------------------------------------------------------
Open your Xcode project and make sure to do the following:
1) Add the ./SnapshotHelper.swift to your UI Test target
You can move the file anywhere you want
2) Call `setLanguage(app)` when launching your app
let app = XCUIApplication()
setLanguage(app)
app.launch()
3) Add `snapshot("0Launch")` to wherever you want to create the
screenshots
More information on GitHub: https://github.com/krausefx/
snapshot
6*ςετͷTFU6QʹՃ
εΫϦʔϯγϣοτΛࡱΓ͍ͨͱ͜ΖʹՃ
6*ςετͷλʔήοτʹՃ
Slide 13
Slide 13 text
No content
Slide 14
Slide 14 text
class Snapshot: XCTestCase {
override func setUp() {
super.setUp()
continueAfterFailure = false
let app = XCUIApplication()
setLanguage(app)
app.launch()
}
func testExample() {
let app = XCUIApplication()
snapshot("01-master")
let tablesQuery = app.tables
tablesQuery.staticTexts["Groceries"].tap()
snapshot("02-detail")
let groceriesNavigationBarsQuery =
app.navigationBars.matchingIdentifier("Groceries")
groceriesNavigationBarsQuery.buttons["Edit"].tap()
snapshot("03-edit")
groceriesNavigationBarsQuery.buttons["Done"].tap()
app.navigationBars.matchingIdentifier("Groceries").buttons["Lister"].tap()
app.navigationBars["Lister"].buttons["Add"].tap()
snapshot("04-add")
}
}