قالب وردپرس درنا توس
Home / IOS Development / # 291: Runs Multiple UI Tests at once with Bluepill 💊 – Little Bites of Cocoa

# 291: Runs Multiple UI Tests at once with Bluepill 💊 – Little Bites of Cocoa



Subjects

Topics

We've covered UI tests over the years, but one thing has always stuck: Running tests can be slow.

Although our individual tests run fast, the whole process is basically "single threaded", slow to start up and complete each passport and is subjected to strange mistakes.

Today we are & # 39; Take a look at Bluepill, a new LinkedIn tool that can help us with all of this by running more iOS Simulators in parallel. Let's go diving.

We start cloning the depot and then run the build script that comes in:

  ./ build.sh

This will build the command line tool. When it's fineness, we can copy the tool somewhere permanently:

  cp build / Build / Products / Debug / bp / usr / local / bin

Change the name of something we can easily identify:

  etc / usr / local / bin / bp / usr / local / bin / bluepill

(Note: / usr / local / bin is a common place to put command line tools on macOS, thanks to the fact that Homebrew puts things there, so it's probably already in our $ 1

9459019 $ PATH ).

Now that we have Bluepill installed, let's try it out.

We can return to our project and run something like:

  ./ bluepill -a ./Spaceships.app - s ./SpaceshipsUITests.xcscheme -o ./output/

This is great for fast races, but ideally we will be able to configure this type of thing once and use it every time. Let's create a fast configuration file using JSON . We will call it
bluepill-config.json :

  {
     "app" :    "./Spaceships.app"  
     "order -path ":  " ./SpaceshipsUITests.xcscheme "  
     "output-dir" :   "./ bluepill-logger /"  
} 

By default, Bluepill will run 4 iOS simulators simultaneously. Before we run the tests, let's turn it up by adding an additional option to our config file:

(This will cause our test to run until 12 iOS Simulators that one time. Very fun).

  {
     "app" :    "./Spaceships.app"  
     "scheme path" :    ./SpaceshipsUITests.xcscheme " ] 
     "output-dir" :    "./ bluepill timber /"   
     "tall-Sims" : [19659049] 12  
}  
 

Finally, we can start our engines:

  ./ bluepill -c bluepill-config.json

So amazing.

Not only do we save tons of time this way, but Bluepill also makes other useful things for us, such as trying again when the simulator hangs or crashes. Tidy.

We've only scratched the surface of what's possible with Bluepill. Be sure to check out README for a complete list of options and default settings.

Learn more about Bluepill at git.io/bluepill.


Source link