google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
463 stars 241 forks source link

Add empty option to drop down widget #995

Closed maanuanubhav999 closed 2 years ago

maanuanubhav999 commented 2 years ago

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #940

Description add an empty option for the dropdown widget.

Alternative(s) considered Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type Choose one: Feature

Screenshots (if applicable)

Checklist

maanuanubhav999 commented 2 years ago

Hey @jingtang10, can you give me some insights on how can I write tests cases for this condition since I tried many methods but they were not working?

Goal

I have to click on the dropdown and select the option for the test case but I couldn't find any method to do the same.

Thing I tried

Something like this could easily be handled with espresso but should I use it? thanks.

Tarun-Bhardwaj commented 2 years ago

@maanuanubhav999 , did you get a clarity on the approach or you need help on this? CC: @jingtang10

maanuanubhav999 commented 2 years ago

Hey, @Tarun-Bhardwaj I would like some help with the writing test. I am not able to find some direct method to do so.

Tarun-Bhardwaj commented 2 years ago

Hey, @Tarun-Bhardwaj I would like some help with the writing test. I am not able to find some direct method to do so.

@anita-vadverao , is this something you could help Anubhav with?

CC: @jingtang10

jingtang10 commented 2 years ago

Have you tried using performClick? search for it in our codebase.

jingtang10 commented 2 years ago

Any update @maanuanubhav999 ?

maanuanubhav999 commented 2 years ago

sorry @jingtang10 didn't get much time this week, will update by tomorrow for sure.

jingtang10 commented 2 years ago

any update on this?

maanuanubhav999 commented 2 years ago

@jingtang10 Thanks for your patience.

I did try running the espresso test but the test seems to be running forever, When I tried debugging it, finding the view could be archived but after performing click on it the weird running forever scenario would happen again.

So I am still working on it.

jingtang10 commented 2 years ago

@jingtang10 Thanks for your patience.

I did try running the espresso test but the test seems to be running forever, When I tried debugging it, finding the view could be archived but after performing click on it the weird running forever scenario would happen again.

So I am still working on it.

Thanks for the update. If you want others to be able to help you need to push your commits so others can see.

jingtang10 commented 2 years ago

@vvikramraj is starting to work on some UI tests so maybe he will be able to help (or this will help him).

@anita-vadverao fyi also

maanuanubhav999 commented 2 years ago

thanks @jingtang10

jingtang10 commented 2 years ago

@epicadk @PallaviGanorkar are you able to take a look and help with this? thanks

jingtang10 commented 2 years ago

please see #1298 from @PallaviGanorkar

codecov[bot] commented 2 years ago

Codecov Report

Merging #995 (a77adf0) into master (08c7d23) will decrease coverage by 0.01%. The diff coverage is 28.57%.

@@             Coverage Diff              @@
##             master     #995      +/-   ##
============================================
- Coverage     84.17%   84.15%   -0.02%     
  Complexity      678      678              
============================================
  Files           147      147              
  Lines         10735    10738       +3     
  Branches        882      883       +1     
============================================
+ Hits           9036     9037       +1     
- Misses         1233     1235       +2     
  Partials        466      466              
Impacted Files Coverage Δ
...iews/QuestionnaireItemDropDownViewHolderFactory.kt 47.61% <28.57%> (-1.10%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e2b40eb...a77adf0. Read the comment docs.