MCPcopy Create free account
hub / github.com/AirtestProject/Poco / wait_for_disappearance

Method wait_for_disappearance

poco/proxy.py:681–698  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 4

existsMethod · 0.95
invalidateMethod · 0.95
PocoTargetTimeoutClass · 0.90

Tested by

no test coverage detected