(self, selector, timeout=5)
| 1550 | return False |
| 1551 | |
| 1552 | async def get_element_rect(self, selector, timeout=5): |
| 1553 | element = await self.select(selector, timeout=timeout) |
| 1554 | coordinates = None |
| 1555 | if ":contains(" in selector: |
| 1556 | position = await element.get_position_async() |
| 1557 | x = position.x |
| 1558 | y = position.y |
| 1559 | width = position.width |
| 1560 | height = position.height |
| 1561 | coordinates = {"x": x, "y": y, "width": width, "height": height} |
| 1562 | else: |
| 1563 | coordinates = await self.js_dumps( |
| 1564 | """document.querySelector('%s').getBoundingClientRect()""" |
| 1565 | % js_utils.escape_quotes_if_needed(re.escape(selector)) |
| 1566 | ) |
| 1567 | return coordinates |
| 1568 | |
| 1569 | async def get_window_rect(self): |
| 1570 | coordinates = {} |
no test coverage detected