e.preventDefault(); // Prevent form submission input.blur(); // remove focus input.value = ""; // optional: clear the input

How To Run iOS UI Tests In Parallel Using Bluepill Tool

It’s very annoying when the test cases take a lot of time to complete the execution. Consider, you have 400+ test cases which take 5-6 hours to complete the test execution.

It will save a lot of time, if we can manage to reduce the test case execution time to 1-2 hours. We can achieve this by running the test cases in parallel using multiple simulators.

So, If you are implementing UI tests at large scale, you must need to achieve less time to complete the test run. You can improve it by using the Bluepill tool.

Introduction to Bluepill

Bluepill is a reliable iOS testing tool created by LinkedIn that runs iOS UI tests in parallel using multiple simulators.

Features 

  • Running tests in parallel by using multiple simulators.
  • Automatically packing tests into groups.
  • Generating a junit report after each test run.
  • Retrying when the Simulator hangs or crashes.

How to use Bluepill?

  1. Get the Bluepill binary

    You can get the build from the source : https://github.com/linkedin/bluepill/releases/Get binary from the (Homebrew) : $ brew install bluepill

  1. Run the tests

    Bluepill is easy to use, you just need to run the following command, and Bluepill will start running four simulators to run your tests in parallel. After the test run, it will generate a report in ./output

    ./bluepill -a ./MyApp.app -s ./MyAppTestScheme.xcscheme -o ./output/

    You can also have a configuration file as mentioned below:

    { 
    
    "app": "./MyAPP.app" 
    "scheme-path": "./MyAPPTestScheme.xcscheme" 
    "output-dir": "./build/" 
    }
    

    And run: ./bluepill -c config.json

Bluepill for fastlane support

You can also integrate the Bluepill into your project by using the fastlane plugin:

fastlane-plugin-bluepill

Fastlane Setup 

  • app : Your application path in derived data (/Products/Debug-iphonesimulator/YOUR_APP_NAME.app )
  • runner_app_path : UI test runner app path in derived data (/Products/Debug-iphonesimulator\YOUR_UITEST_SCHEME_NAME-Runner.app ).
    If there is any space in Scheme name then you have to amend it with backslash in your path.
  • scheme_path : (YOUR_PROJECT.xcodeproj/xcshareddata/xcschemes/YOUR_SCHEME.xcsche me )
  • output_dir : Bluepill reports will generate here
  • num_sims : Number of simulators to be launched.
  • runtime : The iOS version. “iOS 10.X”
  • device : eg: ‘iPhone 6s’
  • You can also use other options available for Bluepill from here: https://github.com/tbrand/fastlane-plugin-bluepill/blob/master/fastlane/Fastfile

Generate Derived Data for Bluepill 

You can generate derived date using fastlane scan:

scan(scheme: YOUR_SCHEME_NAME, 

build_for_testing: true, derived_data_path: "./bluepill", 

buildlog_path: "./bluepill/logs/" )

This will generate derived data inside the bluepill directory.

Configure the Fastfile 

lane: test do 

bluepill( 

app: 'path/to/YOUR_APP_NAME.app', 
scheme: 'path/to/YOUR_APP_NAME.xcscheme', 
output_dir: 'path/to/output_dir', 
device: 'iPhone 6s', number_of_simulators: 4, 
reuse_simulator: true ) 

end

Run the tests using fastlane: $ fastlane test

References 

 

Related Posts

Latest Posts

  • All Posts
  • Generative AI
  • manufacturing
  • News
  • Portfolio
    •   Back
    • Android
    • iOS
    • Java
    • PHP
    • MEAN
    • Ruby
    • DotNet
    • IoT
    • Cloud
    • Testing
    • Roku
    • CMS
    • Python

India

Plot No. 11/2, Phase 3, Hinjewadi Rajiv Gandhi Infotech Park, Pune, India – 411057.
info@tudip.com
+91-96-8990-0537

United States

1999 S. Bascom Ave Suite 700, Campbell CA. 95008, USA.
info@tudip.com
+1-408-216-8162

Canada

64 Caracas Road North York, Toronto Ontario M2K 1B1, Canada.
info@tudip.com

Mexico

Calle Amado Nervo #785 Interior B Colonia Ladron De Guevara 44600 Guadalajara, Jalisco, Mexico.
info@tudip.com

Colombia

Cra. 9 # 113-53 Of. 1405 Bogotá D.C., Colombia.
info@tudip.com

UAE

Tudip Information Technologies L.L.C Office No 109, ABU HAIL BUILDING 13, Abu Hail, Dubai, UAE.
info@tudip.com

Nigeria

22 Kumasi Crescent, Wuse 2, Abuja, Nigeria.
info@tudip.com