EarlGrey icon indicating copy to clipboard operation
EarlGrey copied to clipboard

`grey_text` matcher does not work for SwiftUI `Text` view

Open adil-hussain-84 opened this issue 2 years ago • 1 comments

The grey_text matcher does not work for a SwiftUI Text view. This is demonstrated by the UI testing target defined here which tests the application target defined here.

adil-hussain-84 avatar Dec 13 '21 14:12 adil-hussain-84

I followed the White-Boxing guides and created a helper bundle here. I am able to tunnel calls to GREYHostApplicationDistantObject and define my own custom matchers. However, I am unsure how to define a matcher that matches the text in a SwiftUI Text view. At runtime, the element which corresponds to the SwiftUI Text view is of type SwiftUI.AccessibilityNode. How can I get the text value out from this SwiftUI.AccessibilityNode object?

adil-hussain-84 avatar Jan 05 '22 11:01 adil-hussain-84