0

I have TextInput outside screen with style {position: 'absolute', right: -99}, When i call action typeText(), i receive this error

"Error: Error: Cannot perform action due to constraint(s) failure. Exception with Action: { "Action Name" : "Tap", "Element Description" : "", "Failed Constraint(s)" : "interactable", "All Constraint(s)" : "(!(isSystemAlertViewShown) && ((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) || kindOfClass('UIView')) && (enabled && !(((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(!(enabled))))) && interactable)", "Recovery Suggestion" : "Adjust element properties so that it matches the failed constraint(s)." }

[ { "Description" : "Cannot perform action due to constraint(s) failure.", "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain", "Error Code" : "1", "File Name" : "GREYBaseAction.m", "Function Name" : "-[GREYBaseAction satisfiesConstraintsForElement:error:]", "Line" : "66" } ] " How can i do execute action typeText() with React Native TextInput outside screen

1 Answers1

0

In order for Detox to interact with an element, the element needs to pass visibility criteria. I think the standard is 75% visibility.

detox/docs/Introduction.WritingFirstTest.md

Note that the visibilty matcher makes sure the element is actually visible on screen (at least 75% of it to be exact). If it appears under the fold (eg. the user has to scroll to see it), this specific matcher will fail.


So in summary I don't see how it's possible to type text when the input field is outside the screen.

Antoni4
  • 2,535
  • 24
  • 37