= Running Espresso Scripts - pCloudy documentation

Running Espresso Scripts

Espresso is a testing framework for Android which automatically synchronizes your test actions with the UI of your app. The platform allows you to write concise and reliable Android UI tests.It also lets the test wait until all the background activities have finished.

After the test cases are run you can see the detailed reports. Once automation ends, the device under test will be released automatically so that you or other users can use it later.

There are two ways you can execute espresso test cases.

1. pCloudy UI Dashboard

Here are the steps for running your Test Scripts on multiple Android Devices:

  • Login over www.pcloudy.com with your registered Email ID & Password.
  • Choose Instrumentation Type based on your Test Scripts you’ve written. pCloudy provides support for Instrumentation Type (InstrumentationTestRunner, AndroidJUnitRunner, AndroidXJUnitRunner) for Android. For more information, see Instrumentation in the Testing Fundamentals section of the Android Developer Tools documentation.
  • To schedule "Espresso" over pCloudy, follow the below mentioned steps-
  1. Go to the Automation page and Select the Automation tool as "Espresso"
  2. Espresso
  3. Select "Instrumentation Type" based on your Test Scripts you've written
  4. Espresso
  5. Upload .apk and test.apk file
  6. Espresso
  7. Select device on which test needs to be performed
  8. add the device for testing
  9. Click on Schedule
  10. schedule
  11. Login to pcloudy platform,goto REPORTS page ,click on My Active Session and then click on live-View icon
  12. click to view report
  13. Users are able to see live execution on the Live-View page,Liveview will help you to see the live execution on your test cases.
  14. click to view report
  15. Once execution is over ,users can check the report.To see the report goto “REPORTS” page ,click on “All Reports”.Here click on view icon as shown in below screenshot
click to view report click to view report

2. pCloudy Utility / Espresso Orchestrator

Overview

The pCloudy utility uploads your Application APK, test APK and other APK files to pCloudy. It will then acquire a device to run your test on, execute those tests and report back the status and test report.

  1. Download the espresso starter pack from here and Unzip it,You will find two files
    • a. pCloudy_Espresso.jar
    • b. iConfig.properties
  2. Place the config.properties file and pCloudy_Espresso.js file into the same directory.v
  3. Enter the necessary details in the config.properties file as guided in below screenshot
  4. utility
  5. Open the terminal and run the command “java -jar pCloudy_Espresso.jar”
  6. utility
  7. This will upload the required files which have been mentioned inside the config.properties files.
  8. To the status of the Automation,Login to pcloudy platform,goto “REPORTS” page ,click on “My Active Session” and then click on live-View icon
  9. utility
  10. Users are able to see live execution on the Live-View page, it helps users to see the live execution on your test cases.
  11. utility
  12. Once the test execution is over, You will get a URL of the test execution report on the terminal
  13. utility
  14. To see the report on pCloudy platform ,goto “REPORTS” page ,click on “All Reports”. In the report, all the test details will be there as shown in the screenshots below
  15. utility
  16. Users can also see individual device reports. they can see test case level details,such as performance details, test case logs, device logs, and video files.
  17. utility utility