Espresso test recording feature in Android Studio 2.2 - android

In Android Studio 2.2 there is supposed to be a test recording function? Where do I find it and how do I use it?

Update june 9th:
It is now available with android studio 2.2 preview 3!
Espresso Test Recorder
Demo of the Espresso Test Recorder shown at IO is now included in Preview 3
Screenshot of my pc:
Download it here or patch directly from android studio preview 2.2
Update may 30:
Android Studio 2.2 preview 2 is out, but no 'Record Espresso Test' option yet.
Unfortunately the Espresso Test Recorder is still not in this build; we're addressing a few more issues and then hope to have it ready in the next build!
From the changelog.
Update:
It was not in the Advanced Espresso presentation as I expected, but in What's new in Android development tools (credit to flackery). They show where to find it:
It's also explained in the latest android-developers blog
Espresso Test Recorder: Sometimes writing UI tests can be tedious. With the Record Espresso UI tests feature, creating tests is now as easy as just using your app. Android Studio will capture all your UI interactions and convert them into a fully reusable Espresso Test that you can run locally or even on Firebase Test lab. To use the recorder, go to the Run menu and select Record Espresso Test.
However there is no way to get that option in the current release, updating all (platform)tools etc won't make a difference either.
For now we can only assume that this was unintentionally left out, and will be included in the first next release.
The only sensible thing I could find about this is
Creating tests is now as easy as using your app. Run your app in debug mode and enable recording, and this feature will capture UI events and convert them into Espresso Tests that you can run locally or even in the Firebase Test lab.
From venturebeat
Running in debug is simple, but enabling recording.. I'm not sure what they mean by that. There is a recording option, but that is for capturing the screen and saving it to a mp4 file.
There is currently nothing to be found on the net, and nothing in android studio itself either, that explains this feature in more detail than "it's there".
There will however be a talk at Google I/O today, Advanced Espresso, where they will talk about this new feature and I expect it to be clearer after that.
I will update my answer once I've seen the presentation.

It's now live with Android Studio 2.2 Preview 3. Please send all feedback and issues here: https://code.google.com/p/android/issues/entry?template=Espresso%20Test%20Recorder%20Bug

As described in the Google I/O session 'What's new in Android development tools', we can access the 'Record Espresso Test' from the 'Run' menu.
Unfortunately this item is not available in Android Studio 2.2 Preview 1, and might be made available in a future release.

Related

Testing Google sign-in Android

I'm a student in Computer science. For my software engineering project, I need to implement an Android login with Google.
The login implementation works fine, but I need to test the interface. I use Espresso for testing. The problem is, I really don't know how to do this.
Can someone help me please ? :)
You can start with Espresso recorder, which can be found in the Android Studios:
After this, it will open your application and you can do your E2E (End-to-End) test to your application. After you are ready, you just save the recorder-output and you can try to run your test. Also good video here about Espresso Recorder here.
Beware with the passwords while uploading things to any Version Control.

Are there ways to run testing scripts on an Android device directly?

I am currently testing an app for Android phones using the Espresso library with local devices as well as the Google Firebase Test Lab. For a good portion of these tests to be functional the phone running the test needs to connect to another phone or at least receive feedback from another device. I have been trying to do some research but really can't find anything on what I'm looking to do, seeing that it isn't a common practice.
Is there away to run Espresso or any small script directly on an Android device? I just need a script to sit idle or looping until it receives the information from the tested device, accepts it so the test can continue. I am not trying to alter any direct code in my app to auto accept things, I want to keep the app itself as untouched as possible. And I could manually do it on a small scale, but with Firebase I would like to test lots of devices at once or will run tests daily, sometimes when I'm not there for feedback. I want to automate this process as much as possible, so anything that could do that would help.
I've automated this process completely. The best thing is that you don't have to keep busy of your Android Studio and resources. Everything is done remotely.
You can use this plugin to setup Firebase test lab:
https://github.com/piotrmadry/firebase-test-lab-gradle-plugin
Hopefully you have CI (Continuous Integration) for your project.
So after your setup for test lab (you can define as many devices as you want)
You can create 2 parallel jobs on you CI:
First - it would build your project in normal way
Second - would run android task created by plugin ./gradlew uploadTestLab. After this job you will be able to look at results in Firebase Console.

Easiest way to simulate Cordova plugins?

I'm a relative PHP newbie (10 months) and Javascript absolute novice, so please go easy on me.
I've just started playing with Cordova and have a couple of small apps for use internally within our small business that I could really do with, but testing my code is causing me grief. I've been using Intel XDK with the built in simulator, but it can't simulate SQLite or the FileTransfer plugin.
At the moment, the only way I can see of doing this in XDK would be to compile the app and transfer it to my Samsung mobile for testing, but this seems very cumbersome and will lead to everything taking much longer. I've just found Apache Ripple, but didn't want to spend a day looking into it to find there's a better tool.
Is anybody able to point me at a tutorial page that gives the easiest method for testing a Cordova app with plugin support, please? I tend to work from about 4 different computers, so something web-based that means I can pull the latest version of my code from Google Drive and start working with no setup hassle would be excellent, if it exists.
Cheers
Andy
The Ripple Emulator has similar coverage as the Cordova Simulator. Unlike Ripple, the Simulator can be extended to support specific plugins, but it will require writing simulation code to make that happen. See the cordova-simulate project for details on how to do that.
Otherwise, the next best option (and the most accurate) is to build the app and use remote Chrome DevTools to debug the app (see this XDK doc page for some help with setting that up). It is not necessary to rebuild your app to make this work. If you structure your code so that you can redefine key functions using the JavaScript console, you can actually debug quite a bit without performing a rebuild and reinstall.
Use the interactive JavaScript console to redefine functions within your app and then run those redefined functions directly from the console or restart your app, in situ, using the window.location.reload() function. An example of using this technique can be seen in this video, starting at about 18:30. The video is demonstrating the use of the weinre debugger, but the debugging technique can also be applied to remote CDT when debugging a built app.

android testing, testproject or real device?

I'm final testing a project I've been working on. So far, I've tested the app by installing on various virtual & real devices, and user testing all possible outcomes of the functionality.
Going through the release preparation doc, android test project is the method used in the guide.
I've started to write out some test cases but I can't see the benefit, or additional options from using a test project, that I have not already covered in device/user testing.
Am i wrong to just stick with the device/user tests, or is the test project method just a coded version of the tests I've already completed?
The big advantage of unit-tests is that you can run them always after you did some changes in your code.
This way, it is a lot easier to find a bug which breaks already working functionality.

Android Test Automation

How can i automate Android Apis for better quality ? How can i test the android applications to get a better quality of this software..?
I would recommend you checkout Robolectric for testing Android apps.
Use Robotium, its a good tool to use for Android Automation
http://www.robotium.org/
Try robotium, i am using it, Its very easy for writing your Functional Test Cases and can be tested in all android Devices.
Espresso is the best option coming forward to automate the android API's. Google has developed this testing kit for developers to write the unit test cases. Here's the Google's home page for espresso
https://code.google.com/p/android-test-kit/wiki/EspressoStartGuide
Google has also implemented the sample test cases which help to learn espresso faster. Main advantage of espresso is its speed of execution and its work asynchronously meaning we are not explicitly required to write wait for actions in espresso. Developer should only perform action, waiting time taken care by espresso.
Here's link which gives start to espresso in easy to understand way:
http://www.stevenmarkford.com/android-ui-testing-with-espresso-basics-tutorial/
I would suggest you to use Seetest.
This is also an automation tool independent of any platform. You can run the same test script across all the platforms like Android, IPhone, Windows Phone using this tool. Moreover it has a plugin for existing test frameworks like QTP, Testcomplete etc. Here is the link to download the trial version of the same.
http://experitest.com/support/download-2/
I would suggest Webdriver/ selenium 2.0 android driver if you are looking for open source. its good and robust as well
Try bot-bot. Its a functional automation tool built over Robotium/Nativedriver. It have recording feature which helps in easy element identification and writing test-cases.
It uses "Ant" for build and running the tests. This helps in integration with continuous integration tools.
At the end of your test execution it generates emailable html reports with pass-fail status.
If you have a spare Raspberry-Pi, you can also use that to speedup your test :) , much better than running on Emulator:
Raspberry-PI for Android Test Automation

Categories

Resources