Parallel testing is your ticket to faster testing. When testing applications, it is important to remember that time is an important factor. Testing an application 100% is a noble cause, but it's not always easy to achieve the desired test coverage. Parallel testing allows you to run more tests in a shorter amount of time.
Imagine the situation: you have 500 ui tests that run in 4 hours. Four hours to run is a lot, but if you divide these 500 tests into 8 simulations, the run will take 30 minutes!
Parallelizing tests using Xcode
You will need:
- Xcode version ≥ 11.7;
- Test plan containing ≥ 2 classes with tests.
In the test plan, you need to select “Execute in parallel”
After that, you can simply run all the tests in your test target and Xcode will automatically create multiple clones of the selected simulator. It's important to note that Xcode divides tests into classes, not an equal number of simulators. For example: you have 3 classes with tests:
The first contains - 3;
The second contains - 2;
The third contains - 10.
In this case, xcode will create three simulators and run them on each class with tests. Xcode will not split them equally for each simulator.