Improve error message for androidx.test.espresso.contrib.ActivityResultMatchers#hasResultCode
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 50/100
Research direction
Open espresso/contrib/java/androidx/test/espresso/contrib/ActivityResultMatchers.java and start at ActivityResultMatchers#hasResultCode. Confirm how the mismatch is currently described and make the failure report the actual result code instead of the ActivityResult object. Done means a mismatch shows the returned result code.
Written by the indexing model from the issue text.
Description
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());
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/android-test
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
android/android-test#681 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
android/android-test#2507 · 1 comment ·
-
ξεκσνδξδOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2499 ·
-
ησξξσOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2498 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
android/android-test#2473 ·
All issues in android/android-test
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenAPITools/openapi-generator#25014 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AloisSeckar/demos-java#380 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openhab/openhab-core#5847 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
appsmithorg/appsmith#42297 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100