I am currently trying to automate the process of capturing screenshots of my app. The problem I am facing is, that Snapshot just creates some blank 2x2px Images like this one:
Yes, I have configured Snapshot in the setUp Method:
override func setUp() {
super.setUp()
app = XCUIApplication()
setupSnapshot(app)
app.launch()
}
My UITest method::
func testExample() {
//Screenshot
snapshot("01Screen")
let tablesQuery = app.tables
tablesQuery.cells.element(boundBy: 0).tap()
//Screenshot
snapshot("02Screen")
tablesQuery.cells.element(boundBy: 1).tap()
//Screenshot
snapshot("03Screen")
app.navigationBars.buttons.element(boundBy: 0).tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
tablesQuery.cells.element(boundBy: 2).tap()
tablesQuery.cells.element(boundBy: 0).tap()
//Screenshot
snapshot("04Screen")
app.navigationBars.buttons.element(boundBy: 0).tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
app.navigationBars.buttons.element(boundBy: 0).tap()
}
Has anyone of you experienced the same problem? The UITest can be completed successfully on simulator and physical device.
Best regards schuetzii
EDIT:
I have found out, that this problem may associate with the fact, that I have included some pods. I have no idea how to solve this.
I did
fastlane init
and also
snapshot init
and copied the SnapshotHelper.swift to the UITest-Class. Have I missed anything? New screenshot from the web page, which generates fastlane by itself: