Speed Up Your Tests with Espresso Parallel Testing
Sauce AI for Test Authoring: Move from intent to execution in moment.|xBack to ResourcesBlogPosted September 6, 2018
Speed Up Your Tests with Espresso Parallel Testing
The primary dilemmas of native nomadic app testing include the lack of parallelism, the cost of concurrency with real device hardware, and the challenge of making tests efficient.
In this article, I ’ d like to discuss a solution that can help overcome each of these problem: Running yourGoogle Espressotests on every pull postulation, with faster feedback utilize emulators. While this proficiency should not be the be-all, end-all of your testing strategy, it can help to meet your speed finish while yet providing broad reporting and accurate feedback.
The Problem: Dull Test Results
For the purposes of this article, I ’ ll avoid the emulator-vs.-real devices debate. I want instead to concentrate on when to choose emulator over real devices. For this article, we ’ ll assume that we are practicing shift-left testing by running Google Espresso tests on every pull request, but those tests are running consecutive on a existent device.
Let & # x27; s separate down the problem and discuss the possible solution. Your Espresso smoke test suite is triggered on every pulling asking, which contains 25 tests. Those test run sequentially on a real device.
Why doesn & # x27; t this uninterrupted testing scheme for aboriginal app testing cut it? Because it will typically take 20-25 bit to discharge the smoke tests, and your team has strict service-level agreements (SLAs) around pull-request execution timing, so the timing is not acceptable.
We therefore need a solution to run each test in parallel on separate devices in order to cut the executing clip to less than 3-5 minutes—which is a significant amount of time saved, and translates directly into cost savings by finding bugs betimes in the lifecycle.
For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.
In a perfect world, we would achieve this by have straight-out admission to existent devices at the same toll as practical machines. But let & # x27; s be realistic—access to a real-device farm supporting 25-50 parallel tests would be quite expensive.
So, let ’ s talk about a more naturalistic, cost-effective solution: using Sauce Labs ’ virtual devices (emulators) to action Espresso trial in parallel, at a fraction of the price of existent devices.
The Solution: Parallel Espresso Testing
The emulator is an application that emulate existent roving twist software, hardware, networking, gestures, and operating systems, allowing us to test and debug our native apps on every pull request with maximum speed. Sauce Labs ’ virtual device emulator substructure will help you because it supports the Google Espresso native testing framework. It enables Android developer and quality engineer to run exam in parallel to deliver tight feedback from local development or a uninterrupted integration line.
That ’ s a big pot because most mobile native examine frameworks lack parallelism techniques like Selenium Grid to run multiple tests across different browsers, operating systems, and machines in parallel. This means that doing parallel testing for mobile is harder than for former apps.
To be certain, it may take some doing to get your Espresso tests set up. You may need to build the answer or use open source tools like Spoon or Flank to distribute all your Google Espresso prove across respective emulators in parallel. Flank back parallelism distribution, but I am not 100 % sure that Spoon can combine all the tests, and then execute each test on separate emulators. A solution is needed that spread all Espresso tests and integrates with Sauce Labs ’ emulator infrastructure. Then, you ’ ll be capable of reducing the performance time on pull requests—resulting in cost savings that allow you to stay within your budget.
In conclusion, I ’ ll line that the test strategy described above is no replacement for real-device testing. Real-device tests still belong in your continuous testing strategy for aboriginal apps. Use analytics to drive your real-device strategy to execute tests on the top three device on a nightly scheduled job.
But Espresso testing in parallel on emulator can greatly speed up your test termination overall, without compromise test quality. It ’ s a useful technique for improve the performance of your tests.
Greg Sypolt (@ gregsypolt) is Director of Quality Engineering at Gannett | USA Today Network, a Fixate IO Contributor, and co-founder of Quality Element. He is responsible for examination automation solutions, test reportage (from unit to end-to-end), and uninterrupted integration across all Gannett | USA Today Network ware, and has helped change the testing approach from manual to automated essay across several merchandise at Gannett | USA Today Network. To determine improvements and prove gaps, he conducted a face-to-face consultation sketch summons to translate all ware development and deployment summons, testing strategies, tooling, and interactive in-house training programs.
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free