我有一個註銷函數,在每個tearDown()
期間被調用,但在以這種方式調用時不起作用。如果我在測試過程中調用相同的註銷功能,它可以正常工作。我想知道在拆解過程中XCUI測試有哪些行爲,是否有限制?我試着調試和使用LLDB(espression->寫代碼)調用app.swipeRight()...Xcode UI測試 - swipeRight()在tearDown後不工作
-------
Navbar.swift
-------
import XCTest
import Foundation
class NavbarTest: XCTestCaseLib{
override func setUp()
{
super.setUp()
continueAfterFailure = false
}
override func tearDown()
{
logout()
super.tearDown()
}
func testSideBar_STAGING(){
//...<test code that executes no problem>
//...
}
}
-----
XCTestCaseLib.swift
------
import XCTest
import Foundation
class XCTestCaseLib: XCTestCase {
let app = XCUIApplication()
func logout() {
app.swipeRight()
...
}
你確定了'拆解()'函數執行?在那裏添加一個日誌語句以確保。另外,如果您調用'self.logout()'而不是'logout()',行爲是否會改變? – bneely