chore: auto release commit (2026-09-27 16:42:38)
All checks were successful
技能自动化发布 / release (push) Successful in 12s
All checks were successful
技能自动化发布 / release (push) Successful in 12s
This commit is contained in:
@@ -90,6 +90,19 @@ button = row.get_by_role("button", name="添加")
|
||||
|
||||
Playwright CSS locator 默认可穿透 open Shadow DOM;XPath 不穿透。closed Shadow DOM 无法正常读取时,评估目标应用是否提供可访问性属性,不能注入破解。
|
||||
|
||||
**Web Component 双 input 陷阱**(常见于 `<mc-input>` 等宿主):
|
||||
|
||||
- 轻 DOM 内可能有 **hidden 同步用 input**(`aria-hidden="true"`、`tabindex="-1"`)。
|
||||
- 裸写 `host >> input` 时 Playwright 常默认匹配**第一个** hidden input,等 `visible` 会超时。
|
||||
- 做法:等 **host 可见**作 page ready;输入用 shadow 内真实字段(如 `>> #mc-input-track-input` 或 `>> input.input:not([aria-hidden="true"])`);或 click host + keyboard。
|
||||
|
||||
### Cookie / 同意条(可选出现)
|
||||
|
||||
Profile 已点过「允许全部」后,下次可能**不再出现** Cookie 条。不要无限等待:
|
||||
|
||||
- 短超时(约 2~3s)探测可见 → 点击;
|
||||
- 超时或无元素 → **skip 继续**,不要阻塞主流程。
|
||||
|
||||
### 动态列表
|
||||
|
||||
等待列表完成加载后再读取;`locator.all()` 不会等待动态列表稳定。滚动或刷新后重新获取 locator。
|
||||
@@ -109,6 +122,7 @@ Playwright CSS locator 默认可穿透 open Shadow DOM;XPath 不穿透。close
|
||||
## 6. 禁止模式
|
||||
|
||||
- 用全页所有 `input` 的尺寸和位置猜搜索框。
|
||||
- 对 Web Component 裸用 `host >> input` 且不等 shadow 内真实可编辑 input。
|
||||
- 用 `.first` 绕过严格模式。
|
||||
- 从 DevTools 复制深层 `nth-child` 或绝对 XPath。
|
||||
- 只等 URL 含 `search` 就判定结果成功。
|
||||
|
||||
Reference in New Issue
Block a user