Improve error message for androidx.test.espresso.contrib.ActivityResultMatchers#hasResultCode
还没有人认领这个 Issue。
评估
调研方向
打开 espresso/contrib/java/androidx/test/espresso/contrib/ActivityResultMatchers.java,并从 ActivityResultMatchers#hasResultCode 开始。确认当前如何描述不匹配,并让失败报告显示实际的结果代码,而不是 ActivityResult 对象。完成的标准是:不匹配时显示返回的结果代码。
由索引模型根据 Issue 内容生成。
描述
If there's a mismatch with ActivityResultMatchers#hasResultCode, you currently get an error message like this one, not showing the actual value:
java.lang.AssertionError:
Expected: has result code -1
but: was <android.app.Instrumentation$ActivityResult@af47c58>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
Please override describeMismatchSafely with something like
mismatchDescription.appendText("result code was " + item.getResultCode());
- 主要语言
- Java
- 星标
- 1.2k
- 派生
- 342
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 5
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
android/android-test 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
android/android-test#681 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 72/100
android/android-test#2507 · 1 条评论 ·
-
ξεκσνδξδ未关闭
难度 5/5 一周以上 新手友好度 1/100
android/android-test#2499 ·
-
ησξξσ未关闭
难度 5/5 一周以上 新手友好度 1/100
android/android-test#2498 ·
-
难度 4/5 3-5 天 新手友好度 38/100
android/android-test#2473 ·
查看 android/android-test 的全部 Issue
相似的 Issue
-
link-check link-check:manual
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 91/100
open-telemetry/opentelemetry-java#8870 ·
维护者通常 1 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
enhancement javascript
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area/core kind/bug status/triage team/core-shared
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复