最佳答案
let app = XCUIApplication()
let textPredicate = NSPredicate(format: "label = %@", "3")
expectationForPredicate(textPredicate, evaluatedWithObject: app.staticTexts["numberOfItemsLabel"], handler: nil)
app.buttons["increaseNumberOfItemsButton"].tap()
关于swift - UI测试: How to test if label contains some text after changes?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32273107/