= How to Run Espresso Scripts on pCloudy platform

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

Important - Please note that the steps to automate your tests on the platform using Espresso is slightly different in the New User Interface, please scroll down further for steps on how to perform this on the Old UI.

Here are the steps for running your Test Scripts on multiple Android Devices on the New UI.

  • Login over pCloudy platform 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, enter the duration and the name of the test session and click "Next".
  6. Espresso
  7. Select device on which test needs to be performed, you can use the filter option to narrow down your search and click on the plus sign to add the device.
  8. add the device for testing
  9. Click on Schedule
  10. schedule
  11. Once you have schduled the Test, you can click on REPORTS on the Left Pane, click on My Active Session and then click on live-View icon
  12. click to view report click to view report
  13. Users will be able to see the live execution on the Live-View page. This will help us view the live execution of the test cases.
  14. click to view report
  15. Once the execution is completed, users can view the report summary. Click on "Reports" on the Left Pane and then click on “All Reports”. Here you can click on the view icon as shown in below screenshot
click to view report click to view report

Here are the steps for running your Test Scripts on multiple Android Devices on the Old UI.

  • 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. Config.properties
  2. Place the config.properties file and pCloudy_Espresso.jar 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