You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ChrisMM figured you might be interested in this. The Android Studio beta features a new Espresso Test Recorder that allows you generate automated UI tests by simply recording user interactions with a device.
The beta is currently a bit buggy as some manual changes need to be made to the generated code to get the test work correctly, but hopefully the issues will be worked out by the time the new tool gets out of beta. Even with the current issues, this makes writing UI tests on Android easier than ever before.
@ChrisMM
So the app/build.gradle changes were simply one time changes that needed to be done to ensure the correct espresso dependencies are pulled into the project. This isn't out of the ordinary as this is just something that has to be done in Android anytime a new library is added to the project.
The bulk of the interesting stuff is what's happening in /activity/NoPlayerFoundTest.java. The majority of this file is automatically generated based off of how the Espresso Test Recorder saw that I used the app on my phone. As seen here, some slight adjustments needed to be made to the generated code though. For one, Android Studio was generating overly complicated logic for finding some of the views. I went in and manually simplified this logic since the over complication led to some occasionally failures. The generated code was also using hard coded strings so for the sake of maintainability and cleanliness, I replaced those hardcoded strings with references to the app's existing string resource files.
Even with doing those changes though, using the generated tests as a starting point was a lot faster than starting from scratch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@ChrisMM figured you might be interested in this. The Android Studio beta features a new Espresso Test Recorder that allows you generate automated UI tests by simply recording user interactions with a device.
The beta is currently a bit buggy as some manual changes need to be made to the generated code to get the test work correctly, but hopefully the issues will be worked out by the time the new tool gets out of beta. Even with the current issues, this makes writing UI tests on Android easier than ever before.