Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detox will not typeText because element is not visible enough. #4474

Open
1 of 2 tasks
bob-devereux opened this issue Apr 26, 2024 · 1 comment
Open
1 of 2 tasks

Detox will not typeText because element is not visible enough. #4474

bob-devereux opened this issue Apr 26, 2024 · 1 comment

Comments

@bob-devereux
Copy link

What happened?

This line of detox code generates the following error:
await element(by.type('RCTUITextField').and(by.id('FirstName'))).typeText('John');

Error:

Error: Error Domain=DetoxErrorDomain Code=0 "View “<RCTUITextField: 0x11488c400>” is not visible: View does not pass visibility percent threshold (100)" UserInfo={NSLocalizedDescription=View “<RCTUITextField: 0x11488c400>” is not visible: View does not pass visibility percent threshold (100)}

What was the expected behaviour?

I expected the detox would to type into the react-native TextInput. If I remove the 'flexDirection: 'row' style from the view the TextInput is nested in, detox can find the element and type. I expect Detox to be able to find the element and type into it even if it's nested in a View with flexDirection set.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.20.3
React Native version: 0.72.6
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version: v20.12.1.
Device model: iPhone 15
iOS version: 17.4
macOS version: 14.4.1
Xcode version: 15.2
Test-runner (select one): jest / other

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

Screenshot 2024-04-26 at 4 15 39 PM
@bob-devereux
Copy link
Author

I think the problem might be that the dimensions of the containing view (0 0; 162 52) are smaller than the dimensions of the textinput (0 0; 162.333 56).

| <RCTView: 0x107f8dbe0; frame = (0 0; 162 52); ax.id = "FirstNameInputDefaultView"; ax.label = "First Name First Name  "; layer = <CALayer: 0x6000007603a0>>
|    |    | <RCTTextView: 0x111a29b30; frame = (0 30; 162.333 22.3333); layer = <CALayer: 0x6000003263e0>>
|    |    | <RCTView: 0x111a297d0; frame = (0 0; 162 30); ax.label = "First Name First Name  "; layer = <CALayer: 0x600000325b80>>
|    |    |    | <RCTView: 0x111a29470; frame = (0 0; 162 30); ax.label = "First Name First Name  "; layer = <CALayer: 0x600000325b60>>
|    |    |    |    | <RCTSinglelineTextInputView: 0x11777f400; frame = (0 0; 162.333 56); ax.label = " "; layer = <CALayer: 0x6000007644e0>>
|    |    |    |    |    | <RCTUITextField: 0x1181b6600; frame = (0 0; 162.333 56); ax.id = "FirstName"; ax.value = " "; layer = <CALayer: 0x6000006435e0>>
|    |    |    |    |    |    | <_UITextLayoutCanvasView: 0x111a276e0; frame = (16 24; 130.333 28); layer = <CALayer: 0x6000006439e0>>
|    |    |    |    |    |    |    | <_UITextLayoutFragmentView: 0x11607f500; frame = (0 4.33333; 0 20); layer = <CALayer: 0x60000039c740>>
|    |    |    |    |    |    | <UITextFieldLabel: 0x1140701c0; frame = (16 28; 130.333 20); text = " "; ax.label = " "; layer = <_UILabelLayer: 0x600002651e00>>
|    |    |    |    |    |    | <_UITouchPassthroughView: 0x11606f8b0; frame = (0 0; 130.333 28); layer = <CALayer: 0x600000766ee0>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant