@@ -3,8 +3,6 @@ name: Functional Tests
33on :
44 # Run by manual at this time
55 workflow_dispatch :
6- push :
7- branches : [ master ]
86 pull_request :
97 branches : [ master ]
108
2927 XCODE_VERSION : 16.4
3028 IOS_VERSION : 18.5
3129 IPHONE_MODEL : iPhone 16 Plus
30+ PREBUILT_WDA_PATH : ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
31+ APPIUM_TEST_SERVER_PORT : ' 4723'
32+ APPIUM_TEST_SERVER_HOST : ' 127.0.0.1'
3233
3334 steps :
3435 - uses : actions/checkout@v4
@@ -51,12 +52,44 @@ jobs:
5152 os_version : ${{ env.IOS_VERSION }}
5253
5354 # Start Appium
54- - run : npm install -g appium
5555 - run : |
56+ npm install -g appium
5657 appium driver install xcuitest
57- nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors > appium.log &
58+ nohup appium server \
59+ --port=$APPIUM_TEST_SERVER_PORT \
60+ --address=$APPIUM_TEST_SERVER_HOST \
61+ --relaxed-security \
62+ --log-no-colors \
63+ --log-timestamp \
64+ --keep-alive-timeout 1200 \
65+ 2>&1 > appium.log &
66+
67+ TIMEOUT_SEC=15
68+ INTERVAL_SEC=1
69+
70+ start_time=$(date +%s)
71+ while true; do
72+ current_time=$(date +%s)
73+ elapsed=$((current_time - start_time))
74+
75+ if nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; then
76+ echo "Appium server is running after $elapsed seconds"
77+ popd
78+ cat appium.log
79+ exit 0
80+ fi
81+
82+ if [[ "$elapsed" -ge "$TIMEOUT_SEC" ]]; then
83+ echo "${elapsed} seconds timeout reached: Appium server is NOT running"
84+ exit 1
85+ fi
86+
87+ echo "Waiting $elapsed seconds for Appium server to start..."
88+ sleep "$INTERVAL_SEC"
89+ done
5890
59- - run : appium driver run xcuitest download-wda-sim --platform=ios --outdir=${{ github.workspace }}/wda
91+ - run : |
92+ appium driver run xcuitest download-wda-sim --platform=ios --outdir=$(dirname "$PREBUILT_WDA_PATH")
6093 name: Downloading prebuilt WDA
6194
6295 - name : Set up Python
@@ -69,9 +102,14 @@ jobs:
69102
70103 - name : Run Tests
71104 run : |
72- uv run pytest ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
105+ uv run pytest ${{ matrix.test_targets.target}} \
106+ --doctest-modules \
107+ --junitxml=junit/test-results.xml \
108+ --cov=com \
109+ --cov-report=xml \
110+ --cov-report=html
73111 env :
74- LOCAL_PREBUILT_WDA : ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
112+ LOCAL_PREBUILT_WDA : ${{ env.PREBUILT_WDA_PATH }}
75113
76114 - name : Save server output
77115 if : ${{ always() }}
0 commit comments