检查按钮上背景图像的变化

时间:2016-11-21 04:33:05

标签: swift xcode-ui-testing

我正在对我的应用程序进行测试,我有一个带有单元格的表,并且每个单元格都有一个按钮。当用户点击按钮时,按钮的背景图像会改变。

我想写一个测试,但是如何检查背景图像的变化?

func testChangeBackground() {
    let app = XCUIApplication()
    let tables = app.tables
    let firstCell = tables.cells.allElementsBoundByIndex.first!

    let button = firstCell.buttons.allElementsBoundByIndex.first!
    button.tap()
    ... ?

0 个答案:

没有答案