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

atIndex() has no effect over getAttributes() #4633

Open
1 of 2 tasks
d4vidi opened this issue Nov 13, 2024 · 1 comment
Open
1 of 2 tasks

atIndex() has no effect over getAttributes() #4633

d4vidi opened this issue Nov 13, 2024 · 1 comment

Comments

@d4vidi
Copy link
Collaborator

d4vidi commented Nov 13, 2024

What happened?

The idiomatic way of getting the attributes of a specific element (e.g. at index 1) from a matching list is:

const matches = await element(by.type('android.widget.TextView')).getAttributes());
const element = matches[1];

But the following technique is also valid, technically:

const element = await element(by.type('android.widget.TextView')).atIndex(1).getAttributes();

Seems the latter works on Android, but not iOS. Instead, atIndex() is ignored and the entire list of elements is returned.

What was the expected behaviour?

The API on iOS should behave the same way as on Android.

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:
React Native version:
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version:
Device model:
iOS version:
macOS version:
Xcode version:
Test-runner (select one): jest / other

Detox logs

N/A

Device logs

N/A

More data, please!

No response

Copy link

Hello! We appreciate you bringing this issue to our attention.
It looks like this could be a valuable addition or fix to our project.
We believe that this feature would benefit greatly from contributions from the community,
even from first-time contributors.

If you're interested in contributing to this feature,
please take a look at our contribution guide.
It has all the information you need to know about how to submit a pull request and contribute to our project.

You're also welcome to join our Discord server
and discuss this feature with the collaborators or other contributors under the channel 'contributions'.

Please feel free to reach out to us if you have any questions, or need help with anything.
We appreciate your feedback and look forward to working with you!

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