Reputation: 1
Hello is there any way in UITest via xCode8 to read app current settings? I would like to run app and validate its default settings.
Thanks JJ
Upvotes: 0
Views: 493
Reputation: 2490
You could create a test method in your app and conditionally enable it via an #if UI_TEST
value.
For example, you could set a property in the the UITest compilation environment and verify values by clicking on a test control that was whose presence was determined by whether the app was a UI_TEST and that returned a view with the values you were interested in.
Upvotes: 0
Reputation: 889
XCUI tests can only interact with elements on your app and are unable to validate any data on your app such as the settings in your case.
However you would be able to go to the settings page of your app and use XCTAssert
in order to establish if the settings are how you desire them to be.
Upvotes: 2