* Dynamically Scrolls to an element identified by ID. * * @param {Promise } destinationElementID - ID of the element to scroll up to * @param {number} scrollIdentifier - The identifier (by.id) NOT elementID (element(by.id)). Keep this distinction in mind. If you
(
destinationElementID,
scrollIdentifier,
direction = 'down',
scrollAmount = 350,
)
| 174 | * @param {Detox.Direction} direction - Direction of the scroll (up, down, left, right). The default is down. |
| 175 | * @param {number} [scrollAmount=350] - The amount to scroll (default is 350). Optional parameter. */ |
| 176 | static async scrollToElement( |
| 177 | destinationElementID, |
| 178 | scrollIdentifier, |
| 179 | direction = 'down', |
| 180 | scrollAmount = 350, |
| 181 | ) { |
| 182 | const destinationElement = await destinationElementID; |
| 183 | const scrollableElement = await scrollIdentifier; |
| 184 | |
| 185 | await waitFor(destinationElement) |
| 186 | .toBeVisible() |
| 187 | .whileElement(scrollableElement) |
| 188 | .scroll(scrollAmount, direction); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | export default Gestures; |
no outgoing calls
no test coverage detected