runsForEachTargetApplicationUIConfiguration get configuration

Hi:

I want to know if there's a way to get the configuration used when the app is launched and runsForEachTargetApplicationUIConfiguration is true. This property belongs to XCTestCase for UITests.

Thanks in advance

Hello! There is no way to easily get the current full configuration of your app from inside an XCTestCase- however, you can invent your own method to access parts of its configuration.

You can get the device's current Locale using the Locale.autoupdatingCurrent property: https://developer.apple.com/documentation/foundation/nslocale/1414388-autoupdatingcurrent

(Note: I'm not sure if the above reflects the app's latest locale override, I have not tried it myself in a UI test configurations context)

You can get the device's current orientation using the XCUIDevice.orientation property https://developer.apple.com/documentation/xctest/xcuidevice/1619046-orientation

There is no current way to get the device's global appearance mode from inside a UI test.

If you would like to request any additional features from XCTest, I would encourage you to write up a request on Feedback Assistant: https://feedbackassistant.apple.com/

Thanks for your reply, but the Locale.autoupdatingCurrent does not match the configuration provided by runsForEachTargetApplicationUIConfiguration

runsForEachTargetApplicationUIConfiguration get configuration
 
 
Q