我有一个 logout 函数,它在 every 期间被调用tearDown()
,但在以这种方式调用时不起作用。如果我在测试期间调用相同的注销功能,它工作正常。我想知道在拆卸期间 XCUI 测试的行为是什么,有限制吗?我尝试使用 lldb 调试和调用 app.swipeRight() (espression->write code)...
-------
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()
...
}