Performing UIAccessibilityCustomAction from UITests

前端 未结 2 1391
时光取名叫无心
时光取名叫无心 2020-12-18 11:37

I\'ve got a subclass of UIView, let\'s say it\'s class DemoView: UIView { } which contains UILabel and UIButton. I needed to group it and add UIAccessibilityCus

2条回答
  •  我在风中等你
    2020-12-18 12:00

    The purpose you're tring to reach isn't possible currently with iOS13 and Xcode 11.

    The UITesting framework doesn't access the application code as unit tests do: you can't get an instance to perform selector + the array of custom actions is nil when in UITest ⇒ every custom action isn't reachable and then can't be fired at all.

    XCUITEST works thanks to the accessibility properties like accessibilityIdentifier but isn't definitely designed to simply work for VoiceOver (inconceivable and incomprehensible in my view).

    I hope that something new with UI testing will be introduced during the next WWDC for REAL accessibility testing.

提交回复
热议问题