You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 📜 Description
Improve speed of `scrollUpUntilElementIsBarelyVisible` + reduce its
flakiness.
## 💡 Motivation and Context
Before execution of this method was ~14s. Now it's 7s.
Also a new version reduces flakiness.
The approach is quite simple - knowing keyboard height, device screen
height and element position we can easily calculate the necessary
distance for scroll to place element straight above the keyboard.
Using this approach we don't need to use infinite for-loop and we can
scroll only one time 😎
It's not possible to get keyboard height using Detox, so I calculated
these values myself (we kind of making a process of adding a new device
a little bit more complicated, but e2e tests become more reliable, so I
think it's okay to have these changes).
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### E2E
- added `keyboardHeight` property to device preferences;
- use math calculations to get a scroll distance until element is almost
hidden by keyboard;
## 🤔 How Has This Been Tested?
Tested manually and CI.
## 📸 Screenshots (if appropriate):
<img width="861" alt="image"
src="https://github.com/user-attachments/assets/00630515-b0d4-4156-b15c-ed01dbe96acd"
/>
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
0 commit comments