https://testerhome.com/topics/7544
第一步加swift版本的UITest
第二步
target "supermarketExmapleUITests" do
use_frameworks!
pod 'SwiftMonkey', '~> 1.0.0'
end
第三步
override func setUp() {
super.setUp()
XCUIApplication().launch()
}
override func tearDown() {
super.tearDown()
}
func testMonkey() {
let application = XCUIApplication()
_ = application.descendants(matching: .any).element(boundBy: 0).frame
let monkey = Monkey(frame: application.frame)
monkey.addDefaultXCTestPrivateActions()
monkey.addXCTestTapAlertAction(interval: 100, application: application)
monkey.monkeyAround()
}