Espresso Automation Agenda JSON Config file Optimizing Espresso

  • Slides: 12
Download presentation
Espresso Automation

Espresso Automation

Agenda • JSON Config file • Optimizing Espresso • • 10/7/2020 Parallel Execution Android

Agenda • JSON Config file • Optimizing Espresso • • 10/7/2020 Parallel Execution Android Orchestrator Sharding Test Timeouts © 2015, Perfecto Mobile Ltd. All Rights Reserved. 2

JSON Config File • We can create a file for all the Perfecto configurations

JSON Config File • We can create a file for all the Perfecto configurations • All Perfecto settings in one place • Create JSON file and add reference to it with the config. File. Location param in the gradle file. • Parameter Hierarchy • There are 3 different places where we can set param values 1. Command line argument 2. Build. gradle 3. JSON File The system gives precedence according to above order. We recommend to avoid multiple definitions to avoid confusion and use the JSON file. 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 3

Optimizing Espresso 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 4

Optimizing Espresso 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 4

Upload to repository • To save the transfer time of the app uploaded from

Upload to repository • To save the transfer time of the app uploaded from client to the Perfecto cloud in each test, copy the files to the repository before test execution. • Define the location in the JSON file • Upload via code with Perfecto API • Can be done in Java & triggered from CI "app. Path" : "repository: //[PUBLIC | PRIVATE]: /<path to item>" 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 5

Parallel Execution • To run our entire suite of tests fast, there are several

Parallel Execution • To run our entire suite of tests fast, there are several options to utilize all the Perfecto devices. 1. Run ALL the tests on multiple devices at once – we can define more than one device and then all the devices will open and ALL the tests will be executed on each device. Each device is configured by capabilities i. e a definition of the required device. There is no limit to the # of devices you can configure, beyond the # of devices your license contains. "devices": [ { "platform. Version": "^[678]. *" }, { "model": "Galaxy. *" } 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 6

Run on N Devices 2. Define the amount of devices to run on and

Run on N Devices 2. Define the amount of devices to run on and a random list of devices will open all tests will run on each device. This is a faster, and therefore less specific, way to run on multiple devices. "num. Of. Devices" : 45 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 7

Sharding 3. Sharding splits the tests into multiple devices, so in a suite of

Sharding 3. Sharding splits the tests into multiple devices, so in a suite of 500 tests with 5 devices, each device will run 100 tests. When set to true, sharding will run according to the devices available (defined by capability or #) as shown previously. "shard": true 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 8

Android Orchestrator 4. This setting refers to the execution inside a specific device. Indicates

Android Orchestrator 4. This setting refers to the execution inside a specific device. Indicates that plugin should execute each of the app tests in a separate process using the Android Test Orchestrator. Find JUnit. Runner's Orchestrator official documentation here. 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 9

Test Timeout 5. The timeout allows terminating an execution after a set time. This

Test Timeout 5. The timeout allows terminating an execution after a set time. This aborts “stuck” executions which use a device but do not make any progress. "test. Timeout": 10000, 10/7/2020 © 2015, Perfecto Mobile Ltd. All Rights Reserved. 10

Resources • Espresso Configurations https: //developers. perfectomobile. com/display/PD/Espresso • Android Orchestrator https: //developer. android.

Resources • Espresso Configurations https: //developers. perfectomobile. com/display/PD/Espresso • Android Orchestrator https: //developer. android. com/training/testing/junit-runner#usingandroid-test-orchestrator

Thank You

Thank You