jjj
jjj

Reputation: 1

iOS UITest: How to read app settings in UITest on iOS

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

Answers (2)

ablarg
ablarg

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

Billy Boyo
Billy Boyo

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

Related Questions