calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

iPhone XR and XS Max - issue with device resolutions #1395

Open 0631450519 opened 5 years ago

0631450519 commented 5 years ago

Hello everybody! I have just tried to run our tests on the newest simulators iPhone XR and iPhone XS Max and it was launched and seemed to work but experienced the issue with device resolution (it started to run but when it went to tapping on some element it used wrong location for it and tapped on near one). Let me explain why I think that the issue is related to this. I compared iPhone X where resolution is equal to 1125x2436 pixels and XR (828x1792 pixels), so I was able to use query ("* index:0") for getting the first child element from the whole view and received the same size for some element in pixels. It hasn't to be like that because of different screen sizes (resolutions). To prove that I compared iPhone SE with iPhone 8 where resolutions are not the same and query returned to me different sizes of the chosen element. Please let me know if somebody knows any solution. Thanks in advance! By the way, I used calabash-cucumber #0.21.6

jmoody commented 5 years ago

We are investigating possible resolution issues with the 10R and 10S Max.

However, we have demonstrated that we can touch 4x4 pixel buttons in our test apps in any orientation on the 10R and 10S Max simulators - we are still waiting for phones.

d-konovalov commented 5 years ago

That's strange because we also tried this on our simulators and failed. Maybe the reason is that the elements are placed on a big distance from the origin of the screen? The difference changes respectively the bigger distance is.

psstoyanov commented 5 years ago

Aren't the XR && XS Max using some weird scaling and virtual resolutions (both are considered the same target by xCode for some reason)? I haven't dabbled with those targets myself, just remember a conversation with a colleague (as we were hunting for some other issue). Might be a good idea to see what is being targeted- the virtual or physical screen position.

d-konovalov commented 5 years ago

Currently the only I can see that as the topic starter mentioned, both devices have the same screen resolution as X and XS once tests are being executed, which is weird. And calabash tries to touch elements using those wrong coordinates.

psstoyanov commented 5 years ago

The X and XS have identical screens, there shouldn't be any new issues there. They don't have the same resolution as the other two iPhone additions though. The XR and XS Max are using the same points 414x896 and then rendering them at 2x and 3x respectively to get to their physical resolutions. I don't think there is a good recent example of such behavior from iOS (the jump to retina with the 4 would be the closest one to this I believe). Check this link, might give you some idea of where to look: https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions Perhaps the difference in the expected coordinates and the wrongly used ones will show some consistent behavior.

jmoody commented 5 years ago

@psstoyanov and @d-konovalov are you writing native apps?

As I mentioned, we still don't see any problems testing native apps on these form factors.

d-konovalov commented 5 years ago

Hi @jmoody good point we're testing Xamarin applications

jmoody commented 5 years ago

Check your icons and launch images - make sure you have new assets for the new form factors.

d-konovalov commented 5 years ago

even if the app is started successfully and works well both on x and xs?

jmoody commented 5 years ago

It has nothing to do with successful launches. The problem is that the application is being displayed in a compatibility (sampled) mode. One reason apps are displayed in compatibility mode is that they do not have the correct image assets - at least this has historically been a reason - we are not sure yet for these form factors.

d-konovalov commented 5 years ago

I wanted to say that from the user perspective the app works well also. The only trouble happens once calabash tries to touch anything.

jmoody commented 5 years ago

I understand your situation. I want you to understand our situation. At some point we will probably figure out how to handle compatibility display modes for XS Max and XR - we have no way to reproduce at them moment. You can try to figure out the sample factor and update the server yourself.

https://github.com/calabash/calabash-ios-server/blob/develop/calabash/Classes/Utils/LPDevice.m#L176

My opinion is that calabash is sending you a signal: your application is not being displayed natively on new form factors.

With all that said, maybe I am wrong and there is some sample factor that calabash needs to maintain for these form factors. With the applications that we have, we have not been able to reproduce.