Currently I am testing one iOS app for localization. Is there any way we can take a screenshot of the app screen and we extract a text from that screenshot to compare it with the text coming from the locale string file?
Asked
Active
Viewed 249 times
1 Answers
1
To assert texts use accessibility properties of XCUIElement (value and title) https://developer.apple.com/documentation/xctest/xcuielementattributes
Watch the example here https://github.com/rzakhar/xctest-assignment
To access translations in your tests refer to a Comparing localized UI texts tip from here https://www.vvse.com/blog/blog/2018/01/24/tips-for-using-xcodes-ui-testing-solution-xcuitest/
Make sure to write some extensions to reduce boilerplate code

Roman Zakharov
- 2,185
- 8
- 19