Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd67548052 |
@@ -139,7 +139,14 @@ class TaskRunner(threading.Thread):
|
||||
self._set_current(phase='打开页面', detail=self.url)
|
||||
self._log(f'打开页面: {self.url}')
|
||||
browser.open(self.url, timeout=60)
|
||||
browser.wait('--load', 'networkidle', timeout=45)
|
||||
# 等待页面加载:优先 networkidle;若页面依赖的外部 CDN 挂起导致
|
||||
# networkidle 永不满足,降级为等待 load 事件 + 短暂缓冲,不阻断测试
|
||||
try:
|
||||
browser.wait('--load', 'networkidle', timeout=20)
|
||||
except BrowserError:
|
||||
self._log('networkidle 超时(可能外部 CDN 慢),降级等待 load 事件')
|
||||
browser.wait('--load', 'load', timeout=30)
|
||||
time.sleep(2)
|
||||
self._log('页面已打开')
|
||||
self._set_current(phase='页面已打开')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user