@@ -3,15 +3,17 @@ 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
119concurrency :
1210 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1311 cancel-in-progress : true
1412
13+ env :
14+ APPIUM_TEST_SERVER_PORT : ' 4723'
15+ APPIUM_TEST_SERVER_HOST : ' 127.0.0.1'
16+
1517jobs :
1618 ios_test :
1719 strategy :
2628 # Please make sure the available Xcode versions and iOS versions
2729 # on the runner images. https://github.com/actions/runner-images
2830 env :
29- XCODE_VERSION : 16.4
30- IOS_VERSION : 18.5
31- IPHONE_MODEL : iPhone 16 Plus
31+ XCODE_VERSION : ' 16.4'
32+ IOS_VERSION : ' 18.5'
33+ IPHONE_MODEL : ' iPhone 16 Plus'
34+ PREBUILT_WDA_PATH : ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
3235
3336 steps :
3437 - uses : actions/checkout@v4
@@ -42,43 +45,61 @@ jobs:
4245 uses : maxim-lobanov/setup-xcode@v1
4346 with :
4447 xcode-version : ${{ env.XCODE_VERSION }}
48+
4549 - run : defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
4650
47- - uses : futureware-tech/simulator-action@v3
51+ - name : Prepare iOS simulator
52+ uses : futureware-tech/simulator-action@v4
4853 with :
49- # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
5054 model : ${{ env.IPHONE_MODEL }}
5155 os_version : ${{ env.IOS_VERSION }}
56+ wait_for_boot : true
57+ shutdown_after_job : false
5258
53- # needed?
54- - run : brew install ffmpeg
55-
56- # Start Appium
57- - run : npm install -g appium
58- - run : |
59+ - name : Install Appium and drivers
60+ run : |
61+ npm install -g appium
5962 appium driver install xcuitest
60- appium driver run xcuitest build-wda --sdk=${{ env.IOS_VERSION }} --name='${{ env.IPHONE_MODEL }}'
61- appium plugin install images
62- appium plugin install execute-driver
63- nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors > appium.log &
6463
65- - run : |
66- appium driver run xcuitest download-wda-sim --platform=ios --outdir=${{ github.workspace }}/wda
67- name: Downloading prebuilt WDA
64+ - name : Start Appium server
65+ uses : ./.github/actions/setup-appium-server
66+ with :
67+ port : ${{ env.APPIUM_TEST_SERVER_PORT }}
68+ host : ${{ env.APPIUM_TEST_SERVER_HOST }}
69+ server_args : ' --relaxed-security'
6870
69- - name : Set up Python 3.12
71+ - name : Downloading prebuilt WDA
72+ run : |
73+ appium driver run xcuitest download-wda-sim --platform=ios --outdir=$(dirname "$PREBUILT_WDA_PATH")
74+
75+ - name : Set up Python
7076 uses : actions/setup-python@v5
7177 with :
7278 python-version : 3.12
7379
80+ - name : Cache uv modules
81+ uses : actions/cache@v4
82+ with :
83+ path : |
84+ ~/.cache/uv
85+ .venv
86+ key : ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
87+ restore-keys : |
88+ ${{ runner.os }}-uv-shared-
89+
7490 - name : Install uv
7591 run : make install-uv
7692
7793 - name : Run Tests
7894 run : |
79- uv run pytest ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
95+ uv run pytest ${{ matrix.test_targets.target}} \
96+ --doctest-modules \
97+ --junitxml=junit/test-results.xml \
98+ --cov=com \
99+ --cov-report=xml \
100+ --cov-report=html
80101 env :
81- LOCAL_PREBUILT_WDA : ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
102+ LOCAL_PREBUILT_WDA : ${{ env.PREBUILT_WDA_PATH }}
82103
83104 - name : Save server output
84105 if : ${{ always() }}
@@ -115,13 +136,19 @@ jobs:
115136 with :
116137 node-version : ' lts/*'
117138
118- # Start Appium
119- - run : npm install -g appium
120- - run : |
139+ - name : Install Appium and drivers
140+ run : |
141+ npm install -g appium
121142 appium driver install uiautomator2
122143 appium driver install espresso
123144 appium plugin install execute-driver
124- nohup appium --use-plugins=execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
145+
146+ - name : Start Appium server
147+ uses : ./.github/actions/setup-appium-server
148+ with :
149+ port : ${{ env.APPIUM_TEST_SERVER_PORT }}
150+ host : ${{ env.APPIUM_TEST_SERVER_HOST }}
151+ server_args : ' --relaxed-security --use-plugins=execute-driver'
125152
126153 - name : Enable KVM group perms
127154 run : |
@@ -154,6 +181,16 @@ jobs:
154181 with :
155182 python-version : 3.12
156183
184+ - name : Cache uv modules
185+ uses : actions/cache@v4
186+ with :
187+ path : |
188+ ~/.cache/uv
189+ .venv
190+ key : ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
191+ restore-keys : |
192+ ${{ runner.os }}-uv-shared-
193+
157194 - name : run tests
158195 uses : reactivecircus/android-emulator-runner@v2
159196 with :
@@ -230,15 +267,31 @@ jobs:
230267 with :
231268 node-version : ' lts/*'
232269
233- - name : Install Appium
234- run : npm install --location=global appium
235-
236- - name : Install Android drivers and Run Appium
270+ - name : Install Appium and drivers
237271 if : matrix.e2e-tests == 'flutter-android'
238272 run : |
273+ npm install --location=global appium
239274 appium driver install uiautomator2
240275 appium driver install appium-flutter-integration-driver --source npm
241- nohup appium --allow-insecure=adb_shell --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium_flutter_android.log &
276+
277+ - name : Start Appium server for Android
278+ if : matrix.e2e-tests == 'flutter-android'
279+ uses : ./.github/actions/setup-appium-server
280+ with :
281+ port : ${{ env.APPIUM_TEST_SERVER_PORT }}
282+ host : ${{ env.APPIUM_TEST_SERVER_HOST }}
283+ server_args : ' --relaxed-security'
284+ log_file : ' appium_flutter_android.log'
285+
286+ - name : Cache uv modules
287+ uses : actions/cache@v4
288+ with :
289+ path : |
290+ ~/.cache/uv
291+ .venv
292+ key : ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
293+ restore-keys : |
294+ ${{ runner.os }}-uv-shared-
242295
243296 - name : Run Android tests
244297 if : matrix.e2e-tests == 'flutter-android'
@@ -265,28 +318,40 @@ jobs:
265318 with :
266319 xcode-version : ${{ env.XCODE_VERSION }}
267320
268- - uses : futureware-tech/simulator-action@v3
321+ - uses : futureware-tech/simulator-action@v4
269322 if : matrix.e2e-tests == 'flutter-ios'
270323 with :
271324 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
272325 model : ${{ env.IPHONE_MODEL }}
273326 os_version : ${{ env.IOS_VERSION }}
327+ wait_for_boot : true
328+ shutdown_after_job : false
274329
275- - name : install dependencies
276- if : matrix.e2e-tests == 'flutter-ios'
277- run : brew install ffmpeg
278-
279- - name : Install IOS drivers and Run Appium
330+ - name : Install Appium and drivers
280331 if : matrix.e2e-tests == 'flutter-ios'
281332 run : |
333+ npm install --location=global appium
282334 appium driver install xcuitest
283335 appium driver install appium-flutter-integration-driver --source npm
284336 appium driver run xcuitest build-wda
285- nohup appium --allow-insecure=adb_shell --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium_ios.log &
337+
338+ - name : Start Appium server for iOS
339+ if : matrix.e2e-tests == 'flutter-ios'
340+ uses : ./.github/actions/setup-appium-server
341+ with :
342+ port : ${{ env.APPIUM_TEST_SERVER_PORT }}
343+ host : ${{ env.APPIUM_TEST_SERVER_HOST }}
344+ server_args : ' --relaxed-security'
345+ log_file : ' appium_ios.log'
286346
287347 - name : Run IOS tests
288348 if : matrix.e2e-tests == 'flutter-ios'
289349 run : |
290350 make install-uv
291351 export PLATFORM=ios
292- uv run pytest test/functional/flutter_integration/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
352+ uv run pytest test/functional/flutter_integration/*_test.py \
353+ --doctest-modules \
354+ --junitxml=junit/test-results.xml \
355+ --cov=com \
356+ --cov-report=xml \
357+ --cov-report=html
0 commit comments