Add `state_type=checked|indeterminate` argument to `Get Checkbox State` for tri-state checkboxes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 78/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- playwright, python
- 领域
- testing-qa, tooling
调研方向
从 Browser/keywords/getters.py 开始,阅读现有的 Get Checkbox State 实现及其对 GetBoolProperty 的使用。添加 state_type 的 named-only 处理,然后在测试应用中使用 tri-state checkbox,更新 checkbox 文档和 atest。完成的标准是 checked 仍然是默认值,并且测试覆盖 indeterminate 断言。
由索引模型根据 Issue 内容生成。
描述
Use case
Tri-state checkboxes are standard UI in tree views and "select all" table headers: the parent checkbox is neither checked nor unchecked but indeterminate (element.indeterminate = true). Playwright supports asserting this via toBeChecked({ indeterminate: true }).
Get Checkbox State today only reads the checked property, so an indeterminate checkbox simply reports whatever checked happens to be — the mixed state cannot be asserted. The workaround, Get Property selector indeterminate, works but is undiscoverable: nothing in the checkbox keyword documentation hints at it, and users reasonably expect the checkbox keyword to cover checkbox states.
A small named-only argument on the existing keyword closes this parity gap where users will actually look for it.
Proposed keyword / arguments
Get Checkbox State selector assertion_operator=None assertion_expected=Unchecked message=None state_type=checked
| Argument | Description |
|---|---|
state_type |
New named-only enum: checked (default, current behavior — reads element.checked) or indeterminate (reads element.indeterminate). |
With state_type=indeterminate the keyword returns True when the checkbox is in the mixed state, False otherwise; assertion semantics are unchanged (boolean ==/!=).
*** Test Cases ***
Select All Shows Mixed State
Check Checkbox css=tbody tr:first-child input[type=checkbox]
Get Checkbox State id=select-all == checked state_type=indeterminate
Parent Resolves After Selecting All Rows
Check Checkbox css=tbody tr:nth-child(2) input[type=checkbox]
Get Checkbox State id=select-all == unchecked state_type=indeterminate
Get Checkbox State id=select-all == checked
Playwright API
- expect(locator).toBeChecked with the
indeterminate: trueoption (v1.50).
Implementation notes
- No proto change expected: the wrapper already reads boolean element properties via the generic
GetBoolPropertyRPC (Get Checkbox Statepassesproperty="checked"today); the new argument just switches the property name toindeterminate. Browser/keywords/getters.py: add the named-onlystate_typeargument with aCheckboxStateTypeenum; adjust log/error messages to name the asserted state.- Docs update + atest with a tri-state checkbox in the test app.
Backwards compatibility
Additive named-only argument whose default (checked) preserves current behavior exactly; existing suites are unaffected.
- 主要语言
- Python
- 星标
- 662
- 派生
- 149
- 平均合并
- 6 小时 9 分钟
- 30 天内合并 PR
- 119
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MarketSquare/robotframework-browser 的其他 Issue
-
priority: high
难度 2/5 1-3 小时 新手友好度 75/100
MarketSquare/robotframework-browser#5306 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MarketSquare/robotframework-browser#5153 ·
维护者通常 1 天内回复
-
Record Keyword: allow calling the recorded keyword in the current test case可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
MarketSquare/robotframework-browser#5513 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
MarketSquare/robotframework-browser#5503 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 78/100
MarketSquare/robotframework-browser#5502 ·
维护者通常 1 天内回复
查看 MarketSquare/robotframework-browser 的全部 Issue
相似的 Issue
-
physical
难度 2/5 1-3 小时 新手友好度 74/100
antonyrag/ragleap-core#1339 ·
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 83/100
AllenCell/SubCellSeg#5 ·
-
[🐛 Bug]: oidc_authverifier.py strips trailing slash causing "Invalid token: Invalid issuer" error未关闭
难度 2/5 1-3 小时 新手友好度 76/100
keephq/keep#6934 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug game: 01008BA02525A000 ios
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
needs-triage
难度 1/5 1 小时以内 新手友好度 87/100
gke-labs/kube-agents#5501 ·
维护者通常 1 天内回复