Skip to content

Create FakeHealthService for unit testing #11

@jmichas

Description

@jmichas

It would be cool to create a fake inmemory storage version of the IHealthService for testing.
Android has a library dedicated to this https://developer.android.com/health-and-fitness/health-connect/test/unit-tests

We could do the same thing here.

Also, it would be cool to have a small android and ios app that could be used to populate data on each device, HealthKit/Health Connect for automated UI tests. I guess on Android you could use the toolkit apk, but I have tried to drive it with UI tests yet.

I do a lot of UI tests and the biggest pain is trying to drive the iOS UI to enter in step data because as some of you know a request for permissions can only be checked by reading and getting results. So, my tests all start with a wiped device and my UI test step goes into Health and enters a single step so when my app requests access, the Health dialog shows and I can toggle the switch, but at any time later the only "check" you can do to ensure that the permissions have not been revoked is to do a read op.

Anyway, a small app with documented UI that could be driven by Appium would be super convenient since you wouldn't have to deal with UI changes on different OS versions.

Just noting this really for future work, maybe others will see a benefit, depends on how you test I guess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions