calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

Cannot touch views on iPhone apps emulated on iPad - even in 1X mode #813

Open jmoody opened 9 years ago

jmoody commented 9 years ago

Reproduce

Can be reproduced in Calabash 0.x and Calabash 2.0.

1. $ git clone --recursive git@github.com:calabash/calabash.git
2. $ cd calabash/cucumber/ios
3. $ bundle
3. $ be rake install_apps
4. $ CAL_DEVICE_ID="iPad Air (8.4 Simulator)" be calabash console binaries/iPhoneOnly.app
5. > install_app
6. > start_app
7. > tap("view marked:'Moss'")

Expected

The 'Moss' box to be touched and for 'Moss' to appear in the label.

Found

Nothing happened.

Notes

# Works
> uia_with_main_window("elements()['Moss'].tap()")
jmoody commented 9 years ago

ATTN: @krukow @sapieneptus

sapieneptus commented 9 years ago

@jmoody This is for any iOS version? Or just 8.4?

jmoody commented 9 years ago

Tested on iOS 7 and 8 on sims and devices

sapieneptus commented 9 years ago

@jmoody Is this not a large issue for clients? I'm surprised we haven't heard someone complain ... ?

jmoody commented 9 years ago

It used to be a huge problem. So I am also surprised. I think that many users have switched to universal apps or stopped testing apps emulated on iPads.

I think we might be able to resolve this problem in the same way we resolved the touch-coordinates-are-wrong-after-device-rotation.

https://github.com/calabash/calabash/blob/develop/lib/calabash/ios/device/routes/playback_route_mixin.rb

On Tuesday, August 11, 2015, Chris Fuentes notifications@github.com wrote:

@jmoody https://github.com/jmoody Is this not a large issue for clients? I'm surprised we haven't heard someone complain ... ?

— Reply to this email directly or view it on GitHub https://github.com/calabash/calabash-ios/issues/813#issuecomment-129969847 .

GlennWilson commented 9 years ago

FWIW, in a very limited exploration, where query worked, flash worked, touch did not... I noticed that if I doubled the center co-ordinates returned from the query and did a touch there it seemed to work. I only tried this for one control on one device.

Perhaps some auto scaling of the coordinates could work?