这是我的简单UITest
(在 tabbarcontroller 中自定义选项卡的顺序):
func testIsOrderOfTabsSaved() {
let app = XCUIApplication()
let tabBarsQuery = app.tabBars
tabBarsQuery.buttons["More"].tap()
app.navigationBars["More"].buttons["Edit"].tap()
tabBarsQuery.buttons["Takeaway"].swipeLeft()
tabBarsQuery.buttons["In Restaurant"].swipeLeft()
//here, how to get position of moved button with text "In Restaurant"?
注意:
可以XCUIElement
通过XCUIElementQuery
索引获取。我可以反过来做吗?