Skip to content

Commit

Permalink
Change config for iOS test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaSimsic committed Feb 14, 2025
1 parent 5940d84 commit e9341b3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 41 deletions.
76 changes: 37 additions & 39 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ jobs:
if-no-files-found: ignore
ios-tests:
needs: [scope, mendix-version, project, ios-app]
runs-on: macos-15
runs-on: macos-13
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -497,11 +497,16 @@ jobs:
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: mda

- name: Update Xcode
run: sudo xcode-select --switch /Applications/Xcode_14.2.app
- name: "Clean detox framework cache"
run: npx detox clean-framework-cache
- name: "Build detox framework cache"
run: npx detox build-framework-cache
- name: Install Detox Dependencies
run: |
brew tap wix/brew
brew install applesimutils
- name: "Start runtime"
uses: ./.github/actions/start-runtime
Expand All @@ -513,24 +518,27 @@ jobs:
with:
name: ios-app
path: ios-app
# - name: "List contents of ios-app directory"
# run: |
# echo "Listing contents of ios-app directory:"
# ls -R ios-app
- name: "Move iOS app to correct location"
run: |
mkdir -p detox/apps
find ios-app -type d -iname "*.app" -exec cp -R {} detox/apps/ \;
- name: Install Detox Dependencies
- name: "List contents of apps directory"
run: |
brew tap wix/brew
brew install applesimutils
- name: Check available runtimes
run: xcrun simctl list runtimes
- name: Check avialble device types
run: xcrun simctl list devicetypes
# - name: Create iOS 18.1 simulator for iPhone 16
# run: xcrun simctl create "iPhone 16" com.apple.CoreSimulator.SimDeviceType.iPhone-16 com.apple.CoreSimulator.SimRuntime.iOS-18-1
- name: List supported iOS devices
run: applesimutils --list
echo "Listing contents of detox/apps directory:"
ls -R detox/apps
# - name: Check available runtimes
# run: xcrun simctl list runtimes
# - name: Check available device types
# run: xcrun simctl list devicetypes
# - name: Create iOS 17.5 simulator for iPhone 15
# run: xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15 com.apple.CoreSimulator.SimRuntime.iOS-17-5
# - name: List supported iOS devices
# run: applesimutils --list
# - name: Boot Simulator
# run: xcrun simctl boot "iPhone 15"
# - name: Wait for Simulator to Boot
Expand All @@ -539,43 +547,33 @@ jobs:
# echo "Waiting for simulator to boot..."
# sleep 5
# done
# - name: "Check if simulator is booted"
# run: |
# if ! xcrun simctl list | grep -q "Booted"; then
# echo "Simulator is not booted!"
# exit 1
# # fi
# - name: "List installed apps"
# run: xcrun simctl listapps "iPhone 15"

# - name: "Check if iOS app exists in detox/apps"
# - name: "Wait for app to be ready"
# run: sleep 10

# - name: "Terminate app if running"
# run: |
# APP_PATH="detox/apps/NativeTemplate.app"
# if [ ! -d "$APP_PATH" ]; then
# echo "App not found at path: $APP_PATH"
# else
# echo "App found at path: $APP_PATH"
# if xcrun simctl list apps | grep -q "com.mendix.native.template"; then
# xcrun simctl terminate "iPhone 15" com.mendix.native.template || echo "No app to terminate"
# fi

# - name: "Check if iOS app exists in full BINARY_PATH"
# - name: "Check if iOS app exists"
# run: |
# BINARY_PATH="/Users/runner/work/native-widgets/native-widgets/detox/apps/NativeTemplate.app"
# echo "BINARY_PATH=$BINARY_PATH" >> $GITHUB_ENV
# if [ ! -d "$BINARY_PATH" ]; then
# echo "App not found at path: $BINARY_PATH"
# echo "Listing contents of the apps directory:"
# ls -R /Users/runner/work/native-widgets/native-widgets/detox/apps # List contents of the apps directory for debugging
# else
# echo "App found at path: $BINARY_PATH"
# fi

# - name: "List contents of the app bundle"
# run: |
# echo "Listing contents of the app bundle at $BINARY_PATH:"
# ls -R "$BINARY_PATH"

# - name: "Install app on simulator"
# run: |
# SIMULATOR_ID=$(xcrun simctl list devices | grep "iPhone 15" | grep "Booted" | awk -F '[()]' '{print $2}')
# if [ -z "$SIMULATOR_ID" ]; then
# echo "No booted simulator found for iPhone 15."
# exit 1
# fi
# echo "Installing app on simulator with ID: $SIMULATOR_ID"
# xcrun simctl install "$SIMULATOR_ID" "$BINARY_PATH"

- name: "Run tests"
env:
DETOX_LOGLEVEL: trace
Expand Down
4 changes: 2 additions & 2 deletions detox/detox.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const ANDROID_SDK_VERSION = "30"; // Set to 30 because: https://github.com/wix/Detox/issues/3071
const ANDROID_DEVICE_TYPE = "pixel";
const IOS_SDK_VERSION = "18.1";
const IOS_DEVICE_TYPE = "iPhone 16";
const IOS_SDK_VERSION = "16.2";
const IOS_DEVICE_TYPE = "iPhone 14";

module.exports = {
ANDROID_SDK_VERSION,
Expand Down

0 comments on commit e9341b3

Please sign in to comment.