Skip to content

Commit 5140b4b

Browse files
committed
workflow updates
1 parent a3b5b16 commit 5140b4b

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

.github/workflows/ios-external-test-example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
id: install-ios
6161
uses: ./.github/actions/ios-install
6262
with:
63-
# Use the provided download URL
64-
download_url: ${{ inputs.download_url }}
63+
# Use the provided download URL, or default for automatic triggers
64+
download_url: ${{ inputs.download_url || 'https://github.com/softwareone-platform/mpt-mobile-platform/releases/download/build-Debug-bcd19e4375bfe63b520d4df0fb3a15a5d76383f8-60/app_bundle.zip' }}
6565
ios_version: ${{ inputs.ios_version || '26.0' }}
6666
device_name: ${{ inputs.device_name || 'iPhone 16' }}
6767

scripts/run-local-test.sh

100644100755
Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fi
1818
TEST_TARGET="$1"
1919

2020
# Set required environment variables for local testing
21-
export DEVICE_UDID="6AF2014D-BAB3-4E5E-821B-1D908B9BDCA8" # Use your actual simulator UDID
21+
export DEVICE_UDID="963A992A-A208-4EF4-B7F9-7B2A569EC133" # iPhone 16e (currently booted)
2222
export DEVICE_NAME="iPhone 16"
2323
export PLATFORM_VERSION="26.0"
2424
export APP_BUNDLE_ID="com.softwareone.marketplaceMobile"
@@ -39,6 +39,32 @@ echo ""
3939
echo "📱 Available simulators:"
4040
xcrun simctl list devices | grep iPhone | grep Booted || echo "No booted simulators found"
4141

42+
# Check if Appium is running
43+
echo ""
44+
echo "🚀 Checking Appium server status..."
45+
if ! curl -s "http://$APPIUM_HOST:$APPIUM_PORT/status" > /dev/null 2>&1; then
46+
echo "⚠️ Appium server not running. Starting Appium..."
47+
appium --log-level warn > /tmp/appium.log 2>&1 &
48+
APPIUM_PID=$!
49+
echo "📝 Appium PID: $APPIUM_PID"
50+
51+
# Wait for Appium to start
52+
echo "⏳ Waiting for Appium to start..."
53+
for i in {1..30}; do
54+
if curl -s "http://$APPIUM_HOST:$APPIUM_PORT/status" > /dev/null 2>&1; then
55+
echo "✅ Appium server is ready!"
56+
break
57+
fi
58+
if [ $i -eq 30 ]; then
59+
echo "❌ Appium failed to start after 30 seconds"
60+
exit 1
61+
fi
62+
sleep 1
63+
done
64+
else
65+
echo "✅ Appium server is already running"
66+
fi
67+
4268
# Determine if target is a suite or spec file
4369
if [[ "$TEST_TARGET" == *.js ]]; then
4470
TEST_ARGS="--spec $TEST_TARGET"
@@ -50,6 +76,16 @@ else
5076
echo "🚀 Starting WebDriver tests with suite: $TEST_TARGET"
5177
fi
5278

53-
# Change to app directory and run the test
54-
cd app
55-
npx wdio run wdio.conf.js $TEST_ARGS
79+
# Change to app directory and run tests
80+
cd "$(dirname "$0")/../app"
81+
npx wdio run wdio.conf.js $TEST_ARGS
82+
TEST_EXIT_CODE=$?
83+
84+
# Stop Appium if we started it
85+
if [ ! -z "$APPIUM_PID" ]; then
86+
echo ""
87+
echo "🛑 Stopping Appium server..."
88+
kill $APPIUM_PID 2>/dev/null || true
89+
fi
90+
91+
exit $TEST_EXIT_CODE

0 commit comments

Comments
 (0)