Using the camera during testing

Greetings everyone,

part of my XCUITest includes camera recognition as well as taking snapshots or recordings.

However, I noticed that during my XCUITests on my simulators, that this is not possible.

What I wish to do now, is either to work with a library or any implementation which could help me bypassing this issue in a way that I can still use this functionality or otherwise a way to skip this part of my test during tests on simulators as the code would be also executed on real devices, where the handling of the camera works perfectly fine.

Any ideas? Also I would love to know, how I can check the orientation of the camera and adjust the taking of snasphots/recordings according to it.

Thanks in advance

Using the camera during testing
 
 
Q