(self, selector, timeout=0)
| 1648 | await element.click_async() |
| 1649 | |
| 1650 | async def click_if_visible(self, selector, timeout=0): |
| 1651 | original_selector = selector |
| 1652 | if (":contains(") in selector: |
| 1653 | selector, _ = page_utils.recalculate_selector( |
| 1654 | selector, by="css selector", xp_ok=True |
| 1655 | ) |
| 1656 | if await self.is_element_visible(original_selector): |
| 1657 | with suppress(Exception): |
| 1658 | element = await self.find(selector, timeout=0.01) |
| 1659 | await element.click_async() |
| 1660 | elif timeout == 0: |
| 1661 | return |
| 1662 | else: |
| 1663 | with suppress(Exception): |
| 1664 | await self.find(selector, timeout=timeout) |
| 1665 | if await self.is_element_visible(selector): |
| 1666 | element = await self.find(selector, timeout=0.01) |
| 1667 | await element.click_async() |
| 1668 | |
| 1669 | async def click_with_offset(self, selector, x, y, center=False, timeout=5): |
| 1670 | """Click an element at an {X,Y}-offset location. |
nothing calls this directly
no test coverage detected