SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Improve e2e times and flakiness by using the search (#51590)

Summary:
I'm writing some tests for some APIs/components, and I see some opportunity for improvement in the way how we can write e2e cases for the RNTester.

This diff improves two things:

1. e2e execution times: right now as we are using the `scrollUntilVisible` functionality, it takes quite some time *for some cases*, as some of the items are not very up in the lists and getting to them it's not always very fast.
2. Flakiness: I ran the tests multiple times locally, and in multiple occasions, the `scrollUntilVisible ` did not find anything as the scroll was too fast so the test ended up failing.

Instead of using `scrollUntilVisible` for all cases, we can simply use the search bar which we have in both Components and APIs tabs. This runs faster and we can also share the search flow across multiple test cases, so writing the tests becomes a bit simpler as well.

Initially, I did this for all cases but not all cases benefit from this change as some of them are easier to find than others – the improvement was most notable in iOS (keyboard visibility seems to make a big difference), but I still think it is a good baseline to use the search as if more test cases are added, likely, many of them are not going to be so easy to find.

## Changelog:

[INTERNAL] - Improve e2e times and flakiness by using the search

Pull Request resolved: https://github.com/facebook/react-native/pull/51590

Test Plan:
These are the differences in the time it takes to pass the tests locally.

iOS:

| Before | After |
|--------|-------|
| <img width="336" alt="image" src="https://github.com/user-attachments/assets/6bc80de6-5a10-4c0c-b6b0-f7850d746781" /> | <img width="329" alt="image" src="https://github.com/user-attachments/assets/de47a7ff-84cf-4916-abce-9b3df96a03e1" /> |

<details>
<summary>Android (no significant difference):</summary>

| Before | After |
|--------|-------|
| <img width="328" alt="image" src="https://github.com/user-attachments/assets/73023669-af8e-410c-aee2-529d1cce7acf" /> | <img width="336" alt="image" src="https://github.com/user-attachments/assets/3fb868a9-36f5-43c3-9261-6f2753e28e5f" /> |

</details>

Reviewed By: cortinico

Differential Revision: D75389138

Pulled By: cipolleschi

fbshipit-source-id: cf9d11ab0f84c91eaa20ee5c4441766729925571
M
Mateo Guzmán committed
df6eff4f8c59228f8a171347be6820fea82c3277
Parent: f2c9d74
Committed by Facebook GitHub Bot <[email protected]> on 6/2/2025, 5:16:48 PM