我正在使用 typescript-wdio-appium-jasmine 堆栈进行 iOS 自动化。
在运行我的自动化套件时,launchApp 步骤需要大量时间,并且到那时执行的测试会到达查找元素部分。并且由于此处未找到元素异常而失败,日志:
[0-0] 2021-06-09T08:27:24.418Z INFO webdriver: COMMAND findElement("xpath", "//XCUIElementTypeButton[@name='Continue']")
[0-0] 2021-06-09T08:27:24.419Z INFO webdriver: [POST] http://localhost:4723/wd/hub/session/f16ef593-306c-4a08-a899-7a0a990821a2/element
[0-0] 2021-06-09T08:27:24.419Z INFO webdriver: DATA { using: 'xpath', value: "//XCUIElementTypeButton[@name='Continue']" }
[0-0] 2021-06-09T08:27:24.952Z INFO webdriver: RESULT {
'element-6066-11e4-a52e-4f735466cecf': '20000000-0000-0000-BCDB-000000000000',
ELEMENT: '20000000-0000-0000-BCDB-000000000000'
}
[0-0] 2021-06-09T08:27:24.961Z INFO webdriver: COMMAND isElementDisplayed("20000000-0000-0000-BCDB-000000000000")
[0-0] 2021-06-09T08:27:24.961Z INFO webdriver: [GET] http://localhost:4723/wd/hub/session/f16ef593-306c-4a08-a899-7a0a990821a2/element/20000000-0000-0000-BCDB-000000000000/displayed
[0-0] 2021-06-09T08:27:25.018Z INFO webdriver: RESULT true
[0-0] 2021-06-09T08:27:25.019Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2021-06-09T08:27:25.019Z INFO webdriver: [POST] http://localhost:4723/wd/hub/session/f16ef593-306c-4a08-a899-7a0a990821a2/execute/sync
[0-0] 2021-06-09T08:27:25.019Z INFO webdriver: DATA {
script: 'return (function isElementClickable(elem) {\n' +
' if (!elem.getBoundingClientRect || !elem.scrollIntoView || !elem.contains || !elem.getClientRects || !document.elementFromPoint) {\n' +
' return false;\n' +
' }\n' +
' const isOldEdge = !!window.StyleMedia;\n' +
' const scrollIntoViewFullSupport = !(window.safari || isOldEdge);\n' +