I am using XCode to build an iOS app. I am currently in the process of defining UI tests using the framework added just last year. In an example test I have:
XCUIApplication().segmentedControls["genderSegmentedControl"].buttons["Girl"];
The string "genderSegementedControl" is an accessibility label defined by me in its corresponding view controller as:
genderSegmentedControl.accessibilityLabel = "genderSegmentedControl";
My question is, is there any way of me writing a script, that would check all of my UI objects and verify that they have assigned accessibility label ? I can't seem to find where in Xcode I can view the internals of the story board that I am using. I would love if I could get array of all my objects, and loop through that array and assert that the .accessibilityLabel or .accessibilityIdentifier property is non nil.
I want this so that I can verify that I have actually included all of my UI components in a test. (Some sort of code coverage if you will.)