I am trying to run parallel UI tests using the EarlGrey framework(runs as a unit test target) following this tutorial. I managed to have success when running an XCTest UI target and an EarlGrey test target but i get the following errors when adding another earlgrey test target or when just running two earlgrey test targets at the same time.
The apple script im using is as follows:
tell application "iTerm"
set myterm to create window with default profile
tell myterm
activate current session
launch session "Default Session"
tell the current session
write text "cd ~/Desktop/tddSplitter/Splitter"
write text "xcodebuild clean -workspace Splitter.xcworkspace -scheme EarlGreyWelcomeScreenTests -sdk iphonesimulator11.0 -destination 'platform=iOS Simulator,id=476E9E8C-8248-4EF6-8054-67900D603E83' test | xcpretty" without newline
tell (split vertically with same profile)
write text "cd ~/Desktop/tddSplitter/Splitter"
write text "xcodebuild clean -workspace Splitter.xcworkspace -scheme EarlGreyMyBillsTests -sdk iphonesimulator11.0 -destination 'platform=iOS Simulator,id=F3DEA448-147B-4DDB-AD83-16D18BA1A87F' test | xcpretty" without newline
end tell
tell (split vertically with same profile)
write text "cd ~/Desktop/tddSplitter/Splitter"
write text "xcodebuild clean -workspace Splitter.xcworkspace -scheme EarlGreyNewBillTests -sdk iphonesimulator11.0 -destination 'platform=iOS Simulator,id=9129B18A-BC9A-452C-BA38-B968ED73B9EC' test | xcpretty" without newline
end tell
end tell
write (sessions of current tab) text linefeed
end tell
end tell
The error i get at the bottom of each window fot each test target is the same and as follows:
The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Intermediates.noindex/Splitter.build/Debug-iphonesimulator/Splitter.build/Script-84DCB13FCAD79943430C6362.sh
But above these errors can be other errors, so the last time i ran the script i got the following errors:
For EarlGreyWelcomeScreenTests target:
Testing failed:
/Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Products/Debug-iphonesimulator/Splitter.app/Frameworks/GTMSessionFetcher.framework: No such file or directory
For EarlGreyMyBillsTests target:
Testing failed:
/Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Products/Debug-iphonesimulator/Splitter.app/Frameworks/GTMSessionFetcher.framework: No such file or directory
error: couldn't remove '/Users/waynerumble/Library/Developer/Xcode/DerivedData/Splitter-dujnwkiaikdyiiczdwxhjrusebvf/Build/Products/Debug-iphonesimulator/Splitter.app/Frameworks/GTMSessionFetcher.framework' after command failed: No such file or directory
For EarlGreyNewBillTests target:
Testing failed:
Command builtin-rm failed with exit code 513
Command /bin/sh failed with exit code 1
The only other information i think may help is my Podfile which is as follows:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Splitter' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
inhibit_all_warnings!
def allPods
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'LifetimeTracker'
pod 'iCarousel'
end
def earlGreyUITests
project 'Splitter'
use_frameworks!
inherit! :search_paths
pod 'EarlGrey'
end
# Pods for Splitter
allPods
target 'UnitTests' do
inherit! :search_paths
allPods
end
target 'EarlGreyWelcomeScreenTests' do
earlGreyUITests
allPods
end
target 'EarlGreyMyBillsTests' do
earlGreyUITests
allPods
end
target 'EarlGreyNewBillTests' do
earlGreyUITests
allPods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = "NO"
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
end
Any help or insight would be great as ive been striggling with this for a while and cant seem to get further than this with any new or consistent errors. Thanks