Reputation: 61774
How do I write a UITest
to check whether my label (currently with the text: 2
) has changed its value to 3
or not after I tap my plus button.
Upvotes: 2
Views: 1877
Reputation: 61774
let app = XCUIApplication()
let textPredicate = NSPredicate(format: "label = %@", "3")
expectationForPredicate(textPredicate, evaluatedWithObject: app.staticTexts["numberOfItemsLabel"], handler: nil)
app.buttons["increaseNumberOfItemsButton"].tap()
Upvotes: 2