@@ -196,3 +196,138 @@ jobs:
196196 with :
197197 name : appium-android-${{matrix.test_targets.name}}.log
198198 path : appium.log
199+
200+ flutter_e2e_test :
201+ strategy :
202+ fail-fast : false
203+ matrix :
204+ include :
205+ - platform : macos-14
206+ e2e-tests : flutter-ios
207+ - platform : ubuntu-latest
208+ e2e-tests : flutter-android
209+
210+ runs-on : ${{ matrix.platform }}
211+
212+ env :
213+ API_LEVEL : 29
214+ ARCH : x86
215+ CI : true
216+ XCODE_VERSION : 15.4
217+ IOS_VERSION : 17.5
218+ IPHONE_MODEL : iPhone 15
219+ FLUTTER_ANDROID_APP : " https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/app-debug.apk"
220+ FLUTTER_IOS_APP : " https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/ios.zip"
221+
222+ steps :
223+
224+ - uses : actions/checkout@v4
225+
226+ - uses : actions/setup-java@v4
227+ if : matrix.e2e-tests == 'flutter-android'
228+ with :
229+ distribution : ' zulu'
230+ java-version : ' 17'
231+
232+ - name : Enable KVM group perms
233+ if : matrix.e2e-tests == 'flutter-android'
234+ run : |
235+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
236+ sudo udevadm control --reload-rules
237+ sudo udevadm trigger --name-match=kvm
238+
239+ - name : AVD cache
240+ if : matrix.e2e-tests == 'flutter-android'
241+ uses : actions/cache@v3
242+ id : avd-cache
243+ with :
244+ path : |
245+ ~/.android/avd/*
246+ ~/.android/adb*
247+ key : avd-${{ env.API_LEVEL }}
248+
249+ - name : Create AVD and generate snapshot for caching
250+ if : matrix.e2e-tests == 'flutter-android' && steps.avd-cache.outputs.cache-hit != 'true'
251+ uses : reactivecircus/android-emulator-runner@v2
252+ with :
253+ api-level : ${{ env.API_LEVEL }}
254+ arch : ${{ env.ARCH }}
255+ target : google_apis
256+ force-avd-creation : false
257+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
258+ disable-animations : false
259+ script : echo "Generated AVD snapshot for caching."
260+
261+ - name : Set up Python 3.12
262+ uses : actions/setup-python@v3
263+ with :
264+ python-version : 3.12
265+
266+ - name : Install Node.js
267+ uses : actions/setup-node@v4
268+ with :
269+ node-version : ' lts/*'
270+
271+ - name : Install Appium
272+ run : npm install --location=global appium
273+
274+ - name : Install Android drivers and Run Appium
275+ if : matrix.e2e-tests == 'flutter-android'
276+ run : |
277+ appium driver install uiautomator2
278+ appium driver install appium-flutter-integration-driver --source npm
279+ nohup appium --allow-insecure=adb_shell --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium_android.log &
280+
281+ - name : Run Android tests
282+ if : matrix.e2e-tests == 'flutter-android'
283+ uses : reactivecircus/android-emulator-runner@v2
284+ with :
285+ api-level : ${{ env.API_LEVEL }}
286+ arch : ${{ env.ARCH }}
287+ script : |
288+ pip install --upgrade pip
289+ pip install --upgrade pipenv
290+ pipenv lock --clear
291+ pipenv install -d --system
292+ export PLATFORM=android
293+ pytest test/functional/flutter/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
294+ target : google_apis
295+ profile : Nexus 5X
296+ disable-spellchecker : true
297+ disable-animations : true
298+
299+ - name : Select Xcode
300+ if : matrix.e2e-tests == 'flutter-ios'
301+ uses : maxim-lobanov/setup-xcode@v1
302+ with :
303+ xcode-version : ${{ env.XCODE_VERSION }}
304+ - run : defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
305+
306+ - uses : futureware-tech/simulator-action@v3
307+ with :
308+ # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
309+ model : ${{ env.IPHONE_MODEL }}
310+ os_version : ${{ env.IOS_VERSION }}
311+
312+ - name : install dependencies
313+ if : matrix.e2e-tests == 'flutter-ios'
314+ run : brew install ffmpeg
315+
316+ - name : Install IOS drivers and Run Appium
317+ if : matrix.e2e-tests == 'flutter-ios'
318+ run : |
319+ appium driver install xcuitest
320+ appium driver install appium-flutter-integration-driver --source npm
321+ appium driver run xcuitest build-wda
322+ nohup appium --allow-insecure=adb_shell --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium_ios.log &
323+
324+ - name : Run IOS tests
325+ if : matrix.e2e-tests == 'flutter-ios'
326+ run : |
327+ # Separate 'run' creates differnet pipenv env. Does them in one run for now.
328+ pip install --upgrade pip
329+ pip install --upgrade pipenv
330+ pipenv lock --clear
331+ pipenv install -d --system
332+ export PLATFORM=ios
333+ pytest test/functional/flutter/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
0 commit comments