Basically the question.
I'm currently trying to test a floating widget service that looks like the Messenger Bubble head. I have read the documentation on Expresso UI testing, however, the case I'm dealing with is a bit complicated.
Considering that the floating widget is an Android Service, it is not an Activity and hence cannot use ActivityScenario to test. While so, as the service utilizes a view, I need to conduct UI test on it. How do I test the floating widget using Expresso? I have imported and added all required dependencies to the gradle files, the problem is now the direction to test.
To specify further, what I wish to test include:
- The floating widget service view is visible on the user screen
- Clicking the floating widget will open another expanded view for the user to choose different buttons on. Thereon I will test the button clicking.
- Test whether the floating widget service destroys itself (via stopService) on calling it
- Other minor test (movement, touch, click, background, auto-alignment)