Gets the rect for an element given its location ans size.
( location: webdriver.ILocation, size: webdriver.ISize, )
| 130 | |
| 131 | /** Gets the rect for an element given its location ans size. */ |
| 132 | function getRect( |
| 133 | location: webdriver.ILocation, |
| 134 | size: webdriver.ISize, |
| 135 | ): {top: number; left: number; bottom: number; right: number} { |
| 136 | return { |
| 137 | top: location.y, |
| 138 | left: location.x, |
| 139 | bottom: location.y + size.height, |
| 140 | right: location.x + size.width, |
| 141 | }; |
| 142 | } |
| 143 | |
| 144 | /** Immediately scrolls the viewport to the given offset. */ |
| 145 | function scrollViewportTo(viewportEl: any, offset: number, done: () => void) { |
no outgoing calls
no test coverage detected