代码之家  ›  专栏  ›  技术社区  ›  netshark1000

XCTest:点击SFSafariViewController中的“完成”按钮

  •  1
  • netshark1000  · 技术社区  · 6 年前

    另外,如果我试图用swipright XCode来解决这个问题,那么它会创建一些在测试中无法使用的代码

    let element = app.children(matching: .window).element(boundBy: 0).children(matching: .other).element.children(matching: .other).element.children(matching: .other).element(boundBy: 2)
        element.swipeRight()
    

    enter image description here

    0 回复  |  直到 6 年前
        1
  •  -1
  •   Amaury Vela    5 年前

    这对我很有效:

    let doneButton = app.buttons["Done"]
    waitUntilElementExists(element: doneButton)
    doneButton.tap()
    

    我认为这是成功的关键,我最多等60秒。