[Feature] Add custom description to assertThat and/or Locator naming
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java, playwright
- 领域
- testing-qa
调研方向
首先阅读 PlaywrightAssertions API,以及 issue 中引用的 Locator、Page 和 ApiResponse 类型。比较所请求的断言级和对象级命名示例,然后定义一种一致的受支持方案,使其失败消息包含自定义描述或名称。
由索引模型根据 Issue 内容生成。
描述
With assertJ, we can add a custom name for given asserted object, for example:
Assertions.assertThat(mansion.guests()).as("Living Guests").isEqualTo(7);
Will result in:
[Living Guests] expected:<[7]> but was<[6]>
Selenide comes with element-aliasing as well as the .because() call (that does the similar thing, but not on asserted element, but the assertion itself):
$("div >> span").as("Living Guests").shouldHaveSize(7).because("The guest count should be valid")
The playwright-java assertions would be more readable if we'd be able to do similar thing with PlaywrightAssertions.assertThat or even the Locator/Page/ApiResponse itself, e.g.:
// on assertion:
PlaywrightAssertions.assertThat(questCount).hasText("7").because("The guest count should be valid");
// on asserted object:
PlaywrightAssertions.assertThat(questCount).as("Living Guests").hasText("7");
// on Locator
Locator guestCount = page.locator("div >> span").as("Living Guests");
- 主要语言
- Java
- 星标
- 1.6k
- 派生
- 298
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 14
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/playwright-java 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/playwright-java#1992 ·
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/playwright-java#1991 ·
-
难度 4/5 3-5 天 新手友好度 48/100
microsoft/playwright-java#1990 ·
-
难度 4/5 3-5 天 新手友好度 52/100
microsoft/playwright-java#1989 ·
-
难度 4/5 3-5 天 新手友好度 42/100
microsoft/playwright-java#1963 · 1 条评论 ·
查看 microsoft/playwright-java 的全部 Issue
相似的 Issue
-
Bug Java Platform: Java
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-java#6138 · 1 条评论 ·
-
bug needs triage p2
难度 2/5 1-3 小时 新手友好度 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 条评论 ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/rocketmq-dashboard#4654 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100