1

Simple test case for UILabel Given UILabel has following properties set:

    label.accessibilityLabel = "Hello"
    label.accessibilityTraits = .staticText
    label.isAccessibilityElement = false

This test is successful despite "isAccessibilityElement = false", this test gives false positive result - if I run app Voiceover won't read this element.

        XCTAssert(app.staticTexts["Hello"].exists)

So I thought adding additional check for isAccessibilityElement, but running UI test it is always false(also when label.isAccessibilityElement = true).

        XCTAssert( app.staticTexts["Hello"].isAccessibilityElement) // always false

Am I missing something or "isAccessibilityElement" is not testable? Is there any other approach how to check if element will be actually picked up by assistant e.g. Voiceover?

Oridadedles
  • 831
  • 1
  • 6
  • 8

0 Answers0