I am trying to run my detox tests via my appcenter build but having a bit of trouble, I have created an "appcenter-post-build.sh" script that should run the tests as I currently do locally.
it looks like this
brew tap wix/brew
brew install applesimutils
npm install -g react-native-cli
npm install -g detox-cli
brew tap facebook/fb
brew install fbsimctl --HEAD
if [ "$platform" == "ios" ];
then
detox test --configuration ios.appcenter.debug --take-screenshots failing --cleanup
else
detox test --configuration android.appcenter.debug --take-screenshots failing --cleanup
fi
I also have added a configuration to package.json which looks like
detox": {
"configurations": {
"ios.appcenter.debug": {
"binaryPath": "/Users/runner/Library/Developer/Xcode/DerivedData/HGEMGo-crotfzqsahaubjcqbuyxzjoxbmjt/Build/Intermediates.noindex/ArchiveIntermediates/HGEMGo/InstallationBuildProductsLocation/Applications/HGEMGo.app",
"build": "xcodebuild -workspace ios/HGEMGo.xcworkspace -scheme HGEMGo -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 11"
},
For now i have hardcoded the binary path to where i think the app file is dropped when built , i would like to update this to a more relative path or maybe a process of copying the file to a suitable location in the future.
but when the above script gets executed in the appcenter, I have gathered a few of the errors I am seeing in the logs
field CFBundleIdentifier not found inside Info.plist of app binary at /Users/runner/Library/Developer/Xcode/DerivedData/HGEMGo-crotfzqsahaubjcqbuyxzjoxbmjt/Build/Intermediates.noindex/ArchiveIntermediates/HGEMGo/InstallationBuildProductsLocation/Applications/HGEMGo.app
ReferenceError: device is not defined
ReferenceError: element is not defined