Block and wait until the UI element **disappears** within the given timeout. Args: timeout: maximum waiting time in seconds Raises: PocoTargetTimeout: when timeout
(self, timeout=120)
| 679 | raise PocoTargetTimeout('appearance', self) |
| 680 | |
| 681 | def wait_for_disappearance(self, timeout=120): |
| 682 | """ |
| 683 | Block and wait until the UI element **disappears** within the given timeout. |
| 684 | |
| 685 | Args: |
| 686 | timeout: maximum waiting time in seconds |
| 687 | |
| 688 | Raises: |
| 689 | PocoTargetTimeout: when timeout |
| 690 | """ |
| 691 | |
| 692 | start = time.time() |
| 693 | while self.exists(): |
| 694 | self.poco.sleep_for_polling_interval() |
| 695 | if time.time() - start > timeout: |
| 696 | raise PocoTargetTimeout('disappearance', self) |
| 697 | # 强制重新获取节点状态,避免节点已经存在、又消失后,这里不会刷新节点信息导致exists()永远为True的bug |
| 698 | self.invalidate() |
| 699 | |
| 700 | @refresh_when(PocoTargetRemovedException) |
| 701 | def attr(self, name): |
nothing calls this directly
no test coverage detected