(element: Element, optCoords?: Coordinate | null)
| 28 | // bot.action.click also took a mouse to reuse and a flag forcing mouseup onto |
| 29 | // a non-interactable element. Neither crosses the wire, so they are not kept. |
| 30 | function click(element: Element, optCoords?: Coordinate | null): void { |
| 31 | if (!isShown(element, /* optIgnoreOpacity= */ true)) { |
| 32 | throw botError(ELEMENT_NOT_INTERACTABLE, 'Element is not currently visible and may not be manipulated') |
| 33 | } |
| 34 | scrollIntoView(element, optCoords || undefined) |
| 35 | const mouse = new Mouse() |
| 36 | mouse.move(element, optCoords || interactableCentre(element)) |
| 37 | mouse.pressButton() |
| 38 | mouse.releaseButton() |
| 39 | } |
| 40 | |
| 41 | // An element with no area of its own (an empty inline wrapper, say) is aimed |
| 42 | // at through its offsetParent's size, as bot.action.getInteractableSize did. |
no test coverage detected