Robolectric 4 support
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với ChangeTextBehaviorKtTest đã sao chép và các phần phụ thuộc kiểm thử Gradle được mô tả trong issue, sau đó chạy cả changeText_sameActivity và changeText_newActivity trên Robolectric 4. So sánh lỗi bàn phím và hệ phân cấp show_text_view bị thiếu với hành vi instrumented; hoàn thành có nghĩa là cả hai kiểm thử đều thực thi thành công mà không xóa hành động bàn phím.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
As I have read, tests written with androidx.test.* are supposed to be executed either as an instrumented test (in a real device or emulator) or in the JVM with robolectric 4. So I have copied the ChangeTextBehaviorKtTest in the test folder, and I have added robolectric 4 dependency to gradle file. Also I have copied the rest of androidx.test.* dependencies with testImplementation keyword. Everything seems ok, until I try to execute the tests.
This is what I get:
[Robolectric] com.example.android.testing.espresso.BasicSample.ChangeTextBehaviorKtTest2.changeText_sameActivity: sdk=28; resources=binary
Called loadFromPath(/system/framework/framework-res.apk, true); mode=binary sdk=28
androidx.test.espresso.PerformException: Error performing 'close keyboard' on view 'with id: com.example.android.testing.espresso.BasicSample:id/editTextUserInput'.
<omitted full stacktrace>
Caused by: java.lang.RuntimeException: Attempt to close the soft keyboard did not result in soft keyboard to be hidden. resultCode = -1
So I have removed the call to closeSoftKeyboard() function, as I have noticed that is not necessary with instrumented tests so that they can be executed successfully.
When I remove the call to that funcion, the first test changeText_sameActivity is executed successfully, but the second still fails, with this new exception:
[Robolectric] com.example.android.testing.espresso.BasicSample.ChangeTextBehaviorKtTest2.changeText_newActivity: sdk=28; resources=binary
Called loadFromPath(/system/framework/framework-res.apk, true); mode=binary sdk=28
androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: com.example.android.testing.espresso.BasicSample:id/show_text_view
View Hierarchy:
+>DecorView{id=-1, visibility=VISIBLE, width=320, height=470, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params={(0,0)(fillxfill) ty=APPLICATION wanim=0x10302f8
fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDS
pfl=FORCE_DRAW_STATUS_BAR_BACKGROUND}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
- Ngôn ngữ chính
- Java
- Star
- 9.3k
- Fork
- 3.6k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của android/testing-samples
-
Organic* Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
android/testing-samples#542 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
android/testing-samples#541 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
android/testing-samples#538 · 1 bình luận ·
-
testingsms- deployment Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
android/testing-samples#537 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
android/testing-samples#528 ·
Tất cả issue của android/testing-samples
Issue tương tự
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/flink-agents#1152 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
objectionary/eo-graphs#75 ·