HumanZero HumanZero
HumanZero HumanZero

Reputation: 154

Select ith element in a flatlist in React Native using Detox

After looking through the detox documentation, I do not see a way to grab the i'th element (element with index i) from a Flatlist without including the index in the testID.

I'd like to see if there's a way to do this in a similar way that you can select the ith element in a li in Cypress by using the .eq function like in the example here.

I have tried using atIndex, but this is only made for selecting multiple identical testIDs and selecting one based their position on the screen. This is fundamentally different to how .eq works in Cypress, which actually looks inside an element, given its identifier. I could technically give all of the children of the flatlist the same testID and use atIndex() that way but I would rather have unique testIDs for all elements.

Upvotes: 0

Views: 49

Answers (0)

Related Questions