feat: 增强认证页恢复逻辑,处理 405 错误页面,更新相关测试

This commit is contained in:
QLHazyCoder
2026-04-20 10:59:53 +08:00
parent 7a0ad377d4
commit 4e9acfd2ee
6 changed files with 126 additions and 49 deletions
+6 -1
View File
@@ -15,6 +15,7 @@
isActionEnabled,
isVisibleElement,
log,
routeErrorPattern = null,
simulateClick,
sleep,
throwIfStopped,
@@ -65,9 +66,12 @@
const detailMatched = detailPattern instanceof RegExp
? detailPattern.test(text)
: false;
const routeErrorMatched = routeErrorPattern instanceof RegExp
? routeErrorPattern.test(text)
: false;
const maxCheckAttemptsBlocked = /max_check_attempts/i.test(text);
if (!titleMatched && !detailMatched && !maxCheckAttemptsBlocked) {
if (!titleMatched && !detailMatched && !routeErrorMatched && !maxCheckAttemptsBlocked) {
return null;
}
@@ -78,6 +82,7 @@
retryEnabled: isActionEnabled(retryButton),
titleMatched,
detailMatched,
routeErrorMatched,
maxCheckAttemptsBlocked,
};
}