wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.25k stars 1.92k forks source link

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

Open d4vidi opened 2 weeks ago

d4vidi commented 2 weeks ago

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?

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

github-actions[bot] commented 2 weeks ago

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!