最初,我们在 8 月份就已经开始连续运行自动化测试。一段时间后,它们变得过时了,我们不得不搁置它们。我试图让它们再次工作,在将 Calabash-ios、calabash 服务器和 Calabash 组件更新到 Xamarin Cloud 组件后,我遇到了问题。触摸呼叫不再正常工作。触摸似乎偏离了目标。
例如:我尝试触摸我们应用程序的登录按钮,而不是按下键盘上的“r”按钮。键盘也没有盖住按钮。
我已经尝试过这里给出的解决方法,认为可能是横向导致了问题,但没有运气。
这是使用运行 iOS 8.1 的 iPad 2 模拟器。我也试过 7.1 并且有同样的问题。如果这有什么不同,我们正在使用 Xamarin。
版本:
~$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer/
~$
~$ xcodebuild -version
Xcode 6.1.1
Build version 6A2008a
~$
~$ calabash-ios version
0.11.4
~$
~$ curl http://localhost:37265/version
{
"app_version": "Unknown",
"outcome": "SUCCESS",
"app_id": "com._______.dev",
"simulator_device": "iPad",
"version": "0.11.4",
"app_name": "_____ Dev",
"iphone_app_emulated_on_ipad": false,
"4inch": false,
"git": {
"remote_origin": "git@github.com:calabash/calabash-ios-server.git",
"branch": "master",
"revision": "bcc992b"
},
"screen_dimensions": {
"scale": 1,
"width": 768,
"sample": 1,
"height": 1024
},
"iOS_version": "8.1",
"system": "x86_64",
"simulator": ""
}
我也可以从 calabash-ios 控制台复制它。
这两个命令都单击数字键盘上的“R”按钮:
irb(main):011:0> touch("button marked:'Sign In'")
[
[0] {
"selected" => false,
"enabled" => true,
"rect" => {
"center_x" => 339.6667,
"y" => 341,
"width" => 58,
"x" => 310.6667,
"center_y" => 428,
"height" => 174
},
"id" => nil,
"description" => "<UIButton: 0x78f80b00; frame = (509 310.667; 174 58); opaque = NO; layer = <CALayer: 0x78f80ab0>>",
"label" => "Sign In",
"alpha" => 1,
"class" => "UIButton",
"frame" => {
"y" => 310.6667,
"width" => 174,
"x" => 509,
"height" => 58
}
}
]
irb(main):012:0> tap_point(339, 428)
当此命令正确单击登录按钮时:
irb(main):023:0> tap_point(639, 328)
true
有没有人见过这样的东西?此外,当我使用物理设备时,这不会发生。