mardi 28 février 2017

iOS UITests - Detect if any XCUIElement have ever been tapped on current run

While working on iOS, UITest, how can i detect if specific XCUIElement has already been tapped or not?

For example,

let app = XCUIApplication()
let button1 = app.tabBars.buttons["Home"]
button1.tap()
let button2 = app.tabBars.buttons["Home"].tap()
button2.tap() // Here, I want to detect button2 as already tapped

Aucun commentaire:

Enregistrer un commentaire