From 8602be878f296a4b11f72adee002f3bed5e82ba0 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Wed, 17 Sep 2025 16:01:34 +0530 Subject: [PATCH 01/19] Appium 3 support Co-authored-by: SrinivasanTarget --- .github/workflows/appium3.yml | 146 ++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 2 +- package.json | 12 +-- 3 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/appium3.yml diff --git a/.github/workflows/appium3.yml b/.github/workflows/appium3.yml new file mode 100644 index 0000000..be78576 --- /dev/null +++ b/.github/workflows/appium3.yml @@ -0,0 +1,146 @@ +on: + pull_request: + +name: Appium Flutter Integration Driver with Appium 3 +jobs: + Android_E2E_WDIO: + runs-on: ubuntu-latest + strategy: + matrix: + api-level: [35] + target: [google_apis] + steps: + - name: Check out my other private repo + uses: actions/checkout@master + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + - name: Setup Android SDK + uses: android-actions/setup-android@v2.0.10 + + - name: 'List files' + run: | + release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) + asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) + android_app=$(echo "$asset_urls" | head -n 1) + echo "$android_app" + ios_app=$(echo "$asset_urls" | tail -n 1) + echo "$ios_app" + curl -LO $android_app + ls ${{ github.workspace }} + echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - name: Linting + run: | + npm run build-flutter-by-service + npm install --no-package-lock + npm run prettier-check + - name: Build Driver + run: | + npm run build + - name: Install Drivers + run: | + npm install -g appium + appium driver list + - name: run tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: x86_64 + profile: Nexus 6 + script: | + echo ${{ env }} + adb devices + appium driver list + mkdir ${{ github.workspace }}/appium-logs + adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt & + echo $android_app + APP_PATH=${{ env.APP_PATH }} npm run wdio-android + # appium server -pa=/wd/hub & wait-on http://127.0.0.1:4723/wd/hub/status && + - name: upload appium logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: appium-logs + path: ${{ github.workspace }}/appium-logs + # Android_E2E_JAVA: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # api-level: [ 29 ] + # target: [ google_apis ] + # steps: + # - name: Check out my other private repo + # uses: actions/checkout@master + # - name: Set up JDK 17 + # uses: actions/setup-java@v3 + # with: + # java-version: '17' + # distribution: 'adopt' + # - name: Setup Android SDK + # uses: android-actions/setup-android@v2.0.10 + + # - name: 'List files' + # run: | + # release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) + # asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) + # android_app=$(echo "$asset_urls" | head -n 1) + # echo "$android_app" + # ios_app=$(echo "$asset_urls" | tail -n 1) + # echo "$ios_app" + # curl -LO $android_app + # ls ${{ github.workspace }} + # echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV + # - uses: actions/setup-node@v4 + # with: + # node-version: 20 + # - name: Enable KVM group perms + # run: | + # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + # sudo udevadm control --reload-rules + # sudo udevadm trigger --name-match=kvm + # - name: Linting + # run: | + # npm install --no-package-lock + # npm run prettier-check + # - name: Build Driver + # run: | + # npm run build + # - name: Install Drivers + # run: | + # npm install -g appium@2.19.0 + # appium driver list + # - name: run tests + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # api-level: ${{ matrix.api-level }} + # target: ${{ matrix.target }} + # arch: x86_64 + # profile: Nexus 6 + # script: | + # echo ${{ env }} + # adb devices + # node --version + # appium driver list + # mkdir ${{ github.workspace }}/appium-logs + # adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt & + # echo $android_app + # ls + # APP_PATH=${{ env.APP_PATH }} Platform=android ./gradlew clean test + # # appium server -pa=/wd/hub & wait-on http://127.0.0.1:4723/wd/hub/status && + # - name: upload appium logs + # if: always() + # uses: actions/upload-artifact@v4 + # with: + # name: appium-logs-java + # path: ${{ github.workspace }}/finder/flutter-by/java/appium.log diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a0db1a..192b1c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ on: pull_request: -name: Appium Flutter Integration Driver +name: Appium Flutter Integration Driver with Appium 2.x jobs: Android_E2E_WDIO: runs-on: ubuntu-latest diff --git a/package.json b/package.json index d945a1f..de3660b 100644 --- a/package.json +++ b/package.json @@ -90,14 +90,14 @@ "webdriverio": "9.19.2" }, "peerDependencies": { - "appium": "^2.5.4" + "appium": "^2.5.4 || ^3.0.0" }, "dependencies": { - "@appium/base-driver": "^9.16.4", - "appium-adb": "^12.4.4", - "appium-ios-device": "^2.7.20", - "appium-uiautomator2-driver": "^4.1.5", - "appium-xcuitest-driver": "9.1.2", + "@appium/base-driver": "^9.16.4 || ^10.0.0", + "appium-adb": "^12.4.4 || ^13.0.0", + "appium-ios-device": "^2.7.20 || ^3.0.0", + "appium-uiautomator2-driver": "4.1.5 || ^5.0.0", + "appium-xcuitest-driver": "9.1.2 || ^10.0.0", "async-retry": "^1.3.3", "asyncbox": "^3.0.0", "bluebird": "^3.7.2", From 46a4718d846ca1a0136787280dc7ee5b29cf8713 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Wed, 17 Sep 2025 18:10:54 +0530 Subject: [PATCH 02/19] Up node v22 Co-authored-by: SrinivasanTarget --- .github/workflows/appium3.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/appium3.yml b/.github/workflows/appium3.yml index be78576..41c92b5 100644 --- a/.github/workflows/appium3.yml +++ b/.github/workflows/appium3.yml @@ -33,7 +33,7 @@ jobs: echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - name: Enable KVM group perms run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 192b1c7..336b7cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - name: Enable KVM group perms run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules From 1448ab925aa9648fbf38f28ff4b2e46db9c30f8b Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Wed, 17 Sep 2025 21:45:39 +0530 Subject: [PATCH 03/19] Fix dependencies Co-authored-by: SrinivasanTarget --- package.json | 12 ++++++------ src/driver.ts | 2 +- src/iOS.ts | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index de3660b..b2441c3 100644 --- a/package.json +++ b/package.json @@ -90,14 +90,14 @@ "webdriverio": "9.19.2" }, "peerDependencies": { - "appium": "^2.5.4 || ^3.0.0" + "appium": "^3.0.0" }, "dependencies": { - "@appium/base-driver": "^9.16.4 || ^10.0.0", - "appium-adb": "^12.4.4 || ^13.0.0", - "appium-ios-device": "^2.7.20 || ^3.0.0", - "appium-uiautomator2-driver": "4.1.5 || ^5.0.0", - "appium-xcuitest-driver": "9.1.2 || ^10.0.0", + "@appium/base-driver": "^10.0.0", + "appium-adb": "^13.0.0", + "appium-ios-device": "^3.0.0", + "appium-uiautomator2-driver": "^5.0.0", + "appium-xcuitest-driver": "^10.0.0", "async-retry": "^1.3.3", "asyncbox": "^3.0.0", "bluebird": "^3.7.2", diff --git a/src/driver.ts b/src/driver.ts index 41f057d..336e9fe 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -465,7 +465,7 @@ export class AppiumFlutterDriver extends BaseDriver { // @ts-ignore await this.proxydriver.adb.removePortForward(this.flutterPort); } - await this.proxydriver?.deleteSession(); + await this.proxydriver?.deleteSession(this.sessionId); await super.deleteSession(); } diff --git a/src/iOS.ts b/src/iOS.ts index 80ffd01..f746295 100644 --- a/src/iOS.ts +++ b/src/iOS.ts @@ -1,16 +1,16 @@ import type { AppiumFlutterDriver } from './driver'; // @ts-ignore import { XCUITestDriver } from 'appium-xcuitest-driver'; -import type { InitialOpts } from '@appium/types'; import { DEVICE_CONNECTIONS_FACTORY } from './iProxy'; +import { XCUITestDriverOpts } from 'appium-xcuitest-driver/build/lib/driver'; export async function startIOSSession( this: AppiumFlutterDriver, ...args: any[] ): Promise { this.log.info(`Starting an IOS proxy session`); - const iosdriver = new XCUITestDriver({} as InitialOpts); - await iosdriver.createSession(...args); + const iosdriver = new XCUITestDriver({} as XCUITestDriverOpts); + await iosdriver.createSession.apply(iosdriver, args); return iosdriver; } From ba7f09bd77af363515126b3c7efde870f5d36535 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 08:13:36 +0530 Subject: [PATCH 04/19] Fix CI Co-authored-by: SrinivasanTarget --- .circleci/config.yml | 2 +- .github/workflows/main.yml | 146 ------------------------------------- .github/workflows/test.yml | 2 +- wdio.conf.ts | 2 +- 4 files changed, 3 insertions(+), 149 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index ace2af1..6f7d0dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,7 @@ jobs: echo 'export UDID=$target_sim_id' >> $BASH_ENV xcrun simctl boot $target_sim_id xcrun simctl bootstatus $target_sim_id -b - npm install -g appium@2.19.0 + npm install -g appium npm run build-flutter-by-service npm install --no-package-lock npm run build diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 336b7cc..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,146 +0,0 @@ -on: - pull_request: - -name: Appium Flutter Integration Driver with Appium 2.x -jobs: - Android_E2E_WDIO: - runs-on: ubuntu-latest - strategy: - matrix: - api-level: [35] - target: [google_apis] - steps: - - name: Check out my other private repo - uses: actions/checkout@master - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'adopt' - - name: Setup Android SDK - uses: android-actions/setup-android@v2.0.10 - - - name: 'List files' - run: | - release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) - asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) - android_app=$(echo "$asset_urls" | head -n 1) - echo "$android_app" - ios_app=$(echo "$asset_urls" | tail -n 1) - echo "$ios_app" - curl -LO $android_app - ls ${{ github.workspace }} - echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV - - uses: actions/setup-node@v4 - with: - node-version: 22 - - name: Enable KVM group perms - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - name: Linting - run: | - npm run build-flutter-by-service - npm install --no-package-lock - npm run prettier-check - - name: Build Driver - run: | - npm run build - - name: Install Drivers - run: | - npm install -g appium@2.19.0 - appium driver list - - name: run tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: x86_64 - profile: Nexus 6 - script: | - echo ${{ env }} - adb devices - appium driver list - mkdir ${{ github.workspace }}/appium-logs - adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt & - echo $android_app - APP_PATH=${{ env.APP_PATH }} npm run wdio-android - # appium server -pa=/wd/hub & wait-on http://127.0.0.1:4723/wd/hub/status && - - name: upload appium logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: appium-logs - path: ${{ github.workspace }}/appium-logs - # Android_E2E_JAVA: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # api-level: [ 29 ] - # target: [ google_apis ] - # steps: - # - name: Check out my other private repo - # uses: actions/checkout@master - # - name: Set up JDK 17 - # uses: actions/setup-java@v3 - # with: - # java-version: '17' - # distribution: 'adopt' - # - name: Setup Android SDK - # uses: android-actions/setup-android@v2.0.10 - - # - name: 'List files' - # run: | - # release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) - # asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) - # android_app=$(echo "$asset_urls" | head -n 1) - # echo "$android_app" - # ios_app=$(echo "$asset_urls" | tail -n 1) - # echo "$ios_app" - # curl -LO $android_app - # ls ${{ github.workspace }} - # echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV - # - uses: actions/setup-node@v4 - # with: - # node-version: 20 - # - name: Enable KVM group perms - # run: | - # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - # sudo udevadm control --reload-rules - # sudo udevadm trigger --name-match=kvm - # - name: Linting - # run: | - # npm install --no-package-lock - # npm run prettier-check - # - name: Build Driver - # run: | - # npm run build - # - name: Install Drivers - # run: | - # npm install -g appium@2.19.0 - # appium driver list - # - name: run tests - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # api-level: ${{ matrix.api-level }} - # target: ${{ matrix.target }} - # arch: x86_64 - # profile: Nexus 6 - # script: | - # echo ${{ env }} - # adb devices - # node --version - # appium driver list - # mkdir ${{ github.workspace }}/appium-logs - # adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt & - # echo $android_app - # ls - # APP_PATH=${{ env.APP_PATH }} Platform=android ./gradlew clean test - # # appium server -pa=/wd/hub & wait-on http://127.0.0.1:4723/wd/hub/status && - # - name: upload appium logs - # if: always() - # uses: actions/upload-artifact@v4 - # with: - # name: appium-logs-java - # path: ${{ github.workspace }}/finder/flutter-by/java/appium.log diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 891a285..d0d2a24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - run: npm install --no-package-lock name: Install dependencies - run: npm run build diff --git a/wdio.conf.ts b/wdio.conf.ts index bf7fc09..f224ebe 100644 --- a/wdio.conf.ts +++ b/wdio.conf.ts @@ -126,7 +126,7 @@ export const config: Options.Testrunner = { basePath: '/wd/hub', port: 4723, log: join(process.cwd(), 'appium-logs', 'logs.txt'), - allowInsecure: 'chromedriver_autodownload,adb_shell', + allowInsecure: '*:chromedriver_autodownload,adb_shell', }, }, ], From 59c36f5c9f56b591dcc7a12e2faa92d94183a9d5 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 13:21:21 +0530 Subject: [PATCH 05/19] Update flags for insecure commands Co-authored-by: SrinivasanTarget --- wdio.conf.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wdio.conf.ts b/wdio.conf.ts index f224ebe..9b2e3a1 100644 --- a/wdio.conf.ts +++ b/wdio.conf.ts @@ -126,7 +126,7 @@ export const config: Options.Testrunner = { basePath: '/wd/hub', port: 4723, log: join(process.cwd(), 'appium-logs', 'logs.txt'), - allowInsecure: '*:chromedriver_autodownload,adb_shell', + allowInsecure: '*:chromedriver_autodownload,*:adb_shell', }, }, ], From d0d7cfc3c97e78ad0e64205947641e11098cd619 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 17:23:58 +0530 Subject: [PATCH 06/19] Move ios CI to github actions Co-authored-by: SrinivasanTarget --- .circleci/config.yml | 178 +++++++++--------- .../{appium3.yml => appium3._androidyml} | 4 +- .github/workflows/appium3_ios.yml | 91 +++++++++ test/specs/test.e2e.js | 2 +- 4 files changed, 184 insertions(+), 91 deletions(-) rename .github/workflows/{appium3.yml => appium3._androidyml} (99%) create mode 100644 .github/workflows/appium3_ios.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f7d0dd..a976544 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,78 +1,25 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference +# # Use the latest 2.1 version of CircleCI pipeline process engine. +# # See: https://circleci.com/docs/configuration-reference -# For a detailed guide to building and testing on iOS, read the docs: -# https://circleci.com/docs/testing-ios/ -on: - pull_request: - types: [opened, reopened] -version: 2.1 +# # For a detailed guide to building and testing on iOS, read the docs: +# # https://circleci.com/docs/testing-ios/ +# on: +# pull_request: +# types: [opened, reopened] +# version: 2.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs -jobs: - WDIO_IOS: - # Specify the execution environment. - # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job - macos: - # Specify the Xcode version you desire here - # See: https://circleci.com/docs/using-macos/ - xcode: 15.2.0 - - # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps - steps: - # Checkout the code as the first step. - - checkout - - run: xcrun simctl list devices available - - run: - name: Node Version - command: | - nvm install v22.2.0 && nvm alias default 22.2.0 - - run: - name: Install Appium and Run iOS Test - command: | - release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) - asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) - ios_app=$(echo "$asset_urls" | tail -n 1) - echo "$ios_app" - curl -LO $ios_app - echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV - echo $pwd - echo ls - nvm install v22.2.0 && nvm alias default 22.2.0 - node -v - target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) - echo $target_sim_id - echo 'export UDID=$target_sim_id' >> $BASH_ENV - xcrun simctl boot $target_sim_id - xcrun simctl bootstatus $target_sim_id -b - npm install -g appium - npm run build-flutter-by-service - npm install --no-package-lock - npm run build - appium driver list - appium driver run xcuitest build-wda - wda=$(ls -d /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgent*) - echo $wda - echo 'export WDA_PATH=$wda' >> $BASH_ENV - echo ${WDA_PATH} - echo ${PROJECT_ENV_VAR} - xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app - xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner" - mkdir appium-logs - UDID=$target_sim_id APP_PATH=$ios_app npm run wdio-ios - - - store_artifacts: - path: appium-logs -# JAVA_IOS: +# # Define a job to be invoked later in a workflow. +# # See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs +# jobs: +# WDIO_IOS: # # Specify the execution environment. # # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job -# # Add steps to the job -# # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps # macos: # # Specify the Xcode version you desire here # # See: https://circleci.com/docs/using-macos/ # xcode: 15.2.0 + +# # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps # steps: # # Checkout the code as the first step. # - checkout @@ -90,7 +37,8 @@ jobs: # echo "$ios_app" # curl -LO $ios_app # echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV -# echo $APP_PATH +# echo $pwd +# echo ls # nvm install v22.2.0 && nvm alias default 22.2.0 # node -v # target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) @@ -98,7 +46,8 @@ jobs: # echo 'export UDID=$target_sim_id' >> $BASH_ENV # xcrun simctl boot $target_sim_id # xcrun simctl bootstatus $target_sim_id -b -# npm install -g appium@2.19.0 +# npm install -g appium +# npm run build-flutter-by-service # npm install --no-package-lock # npm run build # appium driver list @@ -111,25 +60,76 @@ jobs: # xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app # xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner" # mkdir appium-logs -# git clone https://github.com/AppiumTestDistribution/flutter-finder.git -# cd flutter-finder/flutter-by/java -# UDID=$target_sim_id APP_PATH=$ios_app Platform=ios ./gradlew clean test --debug +# UDID=$target_sim_id APP_PATH=$ios_app npm run wdio-ios # - store_artifacts: -# path: flutter-finder/flutter-by/java/appium.log -# # Orchestrate jobs using workflows -# # See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows -workflows: - ios: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. - jobs: - - WDIO_IOS: - filters: - branches: - ignore: - - main - # - JAVA_IOS: - # filters: - # branches: - # ignore: - # - main +# path: appium-logs +# # JAVA_IOS: +# # # Specify the execution environment. +# # # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job +# # # Add steps to the job +# # # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps +# # macos: +# # # Specify the Xcode version you desire here +# # # See: https://circleci.com/docs/using-macos/ +# # xcode: 15.2.0 +# # steps: +# # # Checkout the code as the first step. +# # - checkout +# # - run: xcrun simctl list devices available +# # - run: +# # name: Node Version +# # command: | +# # nvm install v22.2.0 && nvm alias default 22.2.0 +# # - run: +# # name: Install Appium and Run iOS Test +# # command: | +# # release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) +# # asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) +# # ios_app=$(echo "$asset_urls" | tail -n 1) +# # echo "$ios_app" +# # curl -LO $ios_app +# # echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV +# # echo $APP_PATH +# # nvm install v22.2.0 && nvm alias default 22.2.0 +# # node -v +# # target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) +# # echo $target_sim_id +# # echo 'export UDID=$target_sim_id' >> $BASH_ENV +# # xcrun simctl boot $target_sim_id +# # xcrun simctl bootstatus $target_sim_id -b +# # npm install -g appium@2.19.0 +# # npm install --no-package-lock +# # npm run build +# # appium driver list +# # appium driver run xcuitest build-wda +# # wda=$(ls -d /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgent*) +# # echo $wda +# # echo 'export WDA_PATH=$wda' >> $BASH_ENV +# # echo ${WDA_PATH} +# # echo ${PROJECT_ENV_VAR} +# # xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app +# # xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner" +# # mkdir appium-logs +# # git clone https://github.com/AppiumTestDistribution/flutter-finder.git +# # cd flutter-finder/flutter-by/java +# # UDID=$target_sim_id APP_PATH=$ios_app Platform=ios ./gradlew clean test --debug + +# # - store_artifacts: +# # path: flutter-finder/flutter-by/java/appium.log +# # # Orchestrate jobs using workflows +# # # See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows +# workflows: +# ios: # This is the name of the workflow, feel free to change it to better match your workflow. +# # Inside the workflow, you define the jobs you want to run. +# jobs: +# - WDIO_IOS: +# filters: +# branches: +# ignore: +# - main +# # - JAVA_IOS: +# # filters: +# # branches: +# # ignore: +# # - main diff --git a/.github/workflows/appium3.yml b/.github/workflows/appium3._androidyml similarity index 99% rename from .github/workflows/appium3.yml rename to .github/workflows/appium3._androidyml index 41c92b5..498428b 100644 --- a/.github/workflows/appium3.yml +++ b/.github/workflows/appium3._androidyml @@ -1,5 +1,7 @@ on: - pull_request: + workflow_dispatch: + push: + branches: [ main ] name: Appium Flutter Integration Driver with Appium 3 jobs: diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml new file mode 100644 index 0000000..a5292c1 --- /dev/null +++ b/.github/workflows/appium3_ios.yml @@ -0,0 +1,91 @@ +name: iOS WDIO Tests + +on: + pull_request: + +env: + CI: true + SHOW_XCODE_LOG: true + PREBUILT_WDA_PATH: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app + +jobs: + wdio_ios: + runs-on: macos-14 + name: WDIO iOS (Xcode 15.4) + steps: + - uses: actions/checkout@v4 + + - name: Install Node.js 22.x + uses: actions/setup-node@v3 + with: + node-version: '22.x' + + - name: Select Xcode 15.4 + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.4' + + - name: List Installed Simulators + run: xcrun simctl list devices available + + - name: Start iOS Simulator UI + run: open -Fn "$(xcode-select --print-path)/Applications/Simulator.app" + + - name: Boot simulator + id: boot_sim + uses: futureware-tech/simulator-action@v4 + with: + model: 'iPhone 14' + os_version: '17.5' + shutdown_after_job: false + wait_for_boot: true + + - name: Capture UDID + id: udid + run: | + target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14 (17.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1) + echo "udid=$target_sim_id" >> $GITHUB_OUTPUT + + - name: Install Appium and deps + run: | + npm install -g appium + npm ci + npm run build-flutter-by-service + npm run build + + - name: Build WDA with XCUITest driver + run: | + appium driver list + appium driver doctor xcuitest + appium driver run xcuitest download-wda-sim --platform=ios --outdir=$(dirname "$PREBUILT_WDA_PATH") + echo "WDA path: $PREBUILT_WDA_PATH" + echo "WDA_PATH=$PREBUILT_WDA_PATH" >> $GITHUB_ENV + + - name: Install and launch WDA on Simulator + run: | + xcrun simctl install "${{ steps.udid.outputs.udid }}" "$PREBUILT_WDA_PATH/WebDriverAgentRunner-Runner.app" + xcrun simctl launch "${{ steps.udid.outputs.udid }}" "com.facebook.WebDriverAgentRunner.xctrunner" + + - name: Download sample iOS app + run: | + release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) + asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) + ios_app=$(echo "$asset_urls" | tail -n 1) + echo "$ios_app" + curl -LO "$ios_app" + echo "APP_PATH=$(pwd)/ios.zip" >> $GITHUB_ENV + + - name: Run WDIO iOS + env: + UDID: ${{ steps.udid.outputs.udid }} + APP_PATH: ${{ env.APP_PATH }} + run: | + mkdir -p appium-logs + UDID=$UDID APP_PATH=$APP_PATH npm run wdio-ios | tee appium-logs/logs.txt + + - name: Upload logs + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: appium-logs + path: appium-logs \ No newline at end of file diff --git a/test/specs/test.e2e.js b/test/specs/test.e2e.js index aa95e5f..d1664b1 100644 --- a/test/specs/test.e2e.js +++ b/test/specs/test.e2e.js @@ -140,7 +140,7 @@ describe('My Login application', () => { }); expect(await childElement.getText()).toEqual('Child 2'); }); - it('Ancestor Test', async () => { + it.only('Ancestor Test', async () => { await performLogin(); await openScreen('Nested Scroll'); const parentElement = await browser.flutterByAncestor$({ From 6dd9b7d8eed3a5bbc4d9c4c7d80c18c46f94b1f5 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 17:37:34 +0530 Subject: [PATCH 07/19] Fix ios github actions Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index a5292c1..0ec314b 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -32,7 +32,7 @@ jobs: run: open -Fn "$(xcode-select --print-path)/Applications/Simulator.app" - name: Boot simulator - id: boot_sim + id: prepareSimulator uses: futureware-tech/simulator-action@v4 with: model: 'iPhone 14' @@ -40,11 +40,9 @@ jobs: shutdown_after_job: false wait_for_boot: true - - name: Capture UDID - id: udid - run: | + - run: | target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14 (17.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1) - echo "udid=$target_sim_id" >> $GITHUB_OUTPUT + echo "udid=$target_sim_id" >> $GITHUB_ENV - name: Install Appium and deps run: | @@ -63,8 +61,8 @@ jobs: - name: Install and launch WDA on Simulator run: | - xcrun simctl install "${{ steps.udid.outputs.udid }}" "$PREBUILT_WDA_PATH/WebDriverAgentRunner-Runner.app" - xcrun simctl launch "${{ steps.udid.outputs.udid }}" "com.facebook.WebDriverAgentRunner.xctrunner" + xcrun simctl install ${{ env.udid }} "$PREBUILT_WDA_PATH/WebDriverAgentRunner-Runner.app" + xcrun simctl launch ${{ env.udid }} "com.facebook.WebDriverAgentRunner.xctrunner" - name: Download sample iOS app run: | @@ -77,7 +75,7 @@ jobs: - name: Run WDIO iOS env: - UDID: ${{ steps.udid.outputs.udid }} + UDID: ${{ env.udid }} APP_PATH: ${{ env.APP_PATH }} run: | mkdir -p appium-logs From 3c50dcdb1f682766a7ce5f934a3ba8ddbcd89267 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 17:47:43 +0530 Subject: [PATCH 08/19] Up xcode version Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index 0ec314b..a727af5 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -20,10 +20,10 @@ jobs: with: node-version: '22.x' - - name: Select Xcode 15.4 + - name: Select Xcode 16.4 uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.4' + xcode-version: '16.4' - name: List Installed Simulators run: xcrun simctl list devices available @@ -35,13 +35,13 @@ jobs: id: prepareSimulator uses: futureware-tech/simulator-action@v4 with: - model: 'iPhone 14' - os_version: '17.5' + model: 'iPhone 16' + os_version: '18.5' shutdown_after_job: false wait_for_boot: true - run: | - target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14 (17.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1) + target_sim_id=$(xcrun simctl list devices available | grep "iPhone 16 (18.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1) echo "udid=$target_sim_id" >> $GITHUB_ENV - name: Install Appium and deps From 89137e10bf321684daddda5232ef72bdda84c343 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 17:50:54 +0530 Subject: [PATCH 09/19] upgrade macos Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index a727af5..ebb092a 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -10,8 +10,8 @@ env: jobs: wdio_ios: - runs-on: macos-14 - name: WDIO iOS (Xcode 15.4) + runs-on: macos-26 + name: WDIO iOS (Xcode 16.4) steps: - uses: actions/checkout@v4 From 63db48d85be33bd65cda8953ccf0c54236de3280 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 18:10:26 +0530 Subject: [PATCH 10/19] Fix CI Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index ebb092a..832acc5 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -47,7 +47,7 @@ jobs: - name: Install Appium and deps run: | npm install -g appium - npm ci + npm install --no-package-lock npm run build-flutter-by-service npm run build @@ -61,7 +61,9 @@ jobs: - name: Install and launch WDA on Simulator run: | - xcrun simctl install ${{ env.udid }} "$PREBUILT_WDA_PATH/WebDriverAgentRunner-Runner.app" + echo "UDID: ${{ env.udid }}" + echo "WDA path: $PREBUILT_WDA_PATH" + xcrun simctl install ${{ env.udid }} "$PREBUILT_WDA_PATH" xcrun simctl launch ${{ env.udid }} "com.facebook.WebDriverAgentRunner.xctrunner" - name: Download sample iOS app From 746483d306a4989ccf670d1ae4113737e2452ddb Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 18:30:09 +0530 Subject: [PATCH 11/19] Fix env for UDID Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index 832acc5..2f4563f 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -42,6 +42,7 @@ jobs: - run: | target_sim_id=$(xcrun simctl list devices available | grep "iPhone 16 (18.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1) + echo "Target sim id: $target_sim_id" echo "udid=$target_sim_id" >> $GITHUB_ENV - name: Install Appium and deps @@ -61,10 +62,10 @@ jobs: - name: Install and launch WDA on Simulator run: | - echo "UDID: ${{ env.udid }}" + echo "UDID: $udid" echo "WDA path: $PREBUILT_WDA_PATH" - xcrun simctl install ${{ env.udid }} "$PREBUILT_WDA_PATH" - xcrun simctl launch ${{ env.udid }} "com.facebook.WebDriverAgentRunner.xctrunner" + xcrun simctl install $udid $PREBUILT_WDA_PATH + xcrun simctl launch $udid "com.facebook.WebDriverAgentRunner.xctrunner" - name: Download sample iOS app run: | @@ -88,4 +89,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: appium-logs - path: appium-logs \ No newline at end of file + path: appium-logs From a23dcc90e2acc342e7ff90c66e55bfda8567c335 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 18:41:55 +0530 Subject: [PATCH 12/19] Fix sim udid grep Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index 2f4563f..f4f8da9 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -41,7 +41,7 @@ jobs: wait_for_boot: true - run: | - target_sim_id=$(xcrun simctl list devices available | grep "iPhone 16 (18.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1) + target_sim_id=$(xcrun simctl list devices available | grep "iPhone 16" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) echo "Target sim id: $target_sim_id" echo "udid=$target_sim_id" >> $GITHUB_ENV From 6627003f843be9781ac8dc97955c6361af8459da Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 20:21:02 +0530 Subject: [PATCH 13/19] Try ios ci again Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index f4f8da9..f7819ac 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -45,44 +45,44 @@ jobs: echo "Target sim id: $target_sim_id" echo "udid=$target_sim_id" >> $GITHUB_ENV - - name: Install Appium and deps - run: | + - run: | npm install -g appium npm install --no-package-lock npm run build-flutter-by-service npm run build - - - name: Build WDA with XCUITest driver - run: | + name: Install Appium and deps + + - run: | appium driver list appium driver doctor xcuitest appium driver run xcuitest download-wda-sim --platform=ios --outdir=$(dirname "$PREBUILT_WDA_PATH") echo "WDA path: $PREBUILT_WDA_PATH" echo "WDA_PATH=$PREBUILT_WDA_PATH" >> $GITHUB_ENV - - - name: Install and launch WDA on Simulator - run: | + name: Build WDA with XCUITest driver + + - run: | echo "UDID: $udid" echo "WDA path: $PREBUILT_WDA_PATH" + xcrun simctl list devices available xcrun simctl install $udid $PREBUILT_WDA_PATH xcrun simctl launch $udid "com.facebook.WebDriverAgentRunner.xctrunner" + name: Install and launch WDA on Simulator + - - name: Download sample iOS app - run: | + - run: | release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) ios_app=$(echo "$asset_urls" | tail -n 1) echo "$ios_app" curl -LO "$ios_app" echo "APP_PATH=$(pwd)/ios.zip" >> $GITHUB_ENV - - - name: Run WDIO iOS - env: - UDID: ${{ env.udid }} - APP_PATH: ${{ env.APP_PATH }} - run: | + name: Download sample iOS app + + - run: | mkdir -p appium-logs - UDID=$UDID APP_PATH=$APP_PATH npm run wdio-ios | tee appium-logs/logs.txt + UDID=$udid APP_PATH=$APP_PATH npm run wdio-ios | tee appium-logs/logs.txt + name: Run WDIO iOS + - name: Upload logs if: ${{ always() }} From 3078373d61895447782189f64a5e225a3bbfce70 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 20:38:50 +0530 Subject: [PATCH 14/19] Fix getting UDID for iOS Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index f7819ac..c6e40eb 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -41,7 +41,7 @@ jobs: wait_for_boot: true - run: | - target_sim_id=$(xcrun simctl list devices available | grep "iPhone 16" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) + target_sim_id=$(xcrun simctl list devices available | grep -A 10 "iOS 18.5" | grep "iPhone 16" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) echo "Target sim id: $target_sim_id" echo "udid=$target_sim_id" >> $GITHUB_ENV From bf779e8c5b77c2454492ccdf868266e804b5b5cb Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 21:22:01 +0530 Subject: [PATCH 15/19] Fix sim udid Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index c6e40eb..27a9955 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -41,7 +41,7 @@ jobs: wait_for_boot: true - run: | - target_sim_id=$(xcrun simctl list devices available | grep -A 10 "iOS 18.5" | grep "iPhone 16" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) + target_sim_id=$(xcrun simctl list devices available | grep -A 10 "Booted" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) echo "Target sim id: $target_sim_id" echo "udid=$target_sim_id" >> $GITHUB_ENV @@ -63,7 +63,6 @@ jobs: - run: | echo "UDID: $udid" echo "WDA path: $PREBUILT_WDA_PATH" - xcrun simctl list devices available xcrun simctl install $udid $PREBUILT_WDA_PATH xcrun simctl launch $udid "com.facebook.WebDriverAgentRunner.xctrunner" name: Install and launch WDA on Simulator From b26724b8adf89e649b047ba6ae7906dca6e1cacc Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 22:09:12 +0530 Subject: [PATCH 16/19] Fix download ios.zip Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index 27a9955..02500cb 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -27,7 +27,16 @@ jobs: - name: List Installed Simulators run: xcrun simctl list devices available + - name: Install jq + run: brew install jq + - run: | + ios_app=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest | jq -r '.assets[] | select(.name=="ios.zip") | .browser_download_url') + echo "Downloading from: $ios_app" + curl -LO "$ios_app" + echo "APP_PATH=$(pwd)/ios.zip" >> $GITHUB_ENV + name: Download sample iOS app + - name: Start iOS Simulator UI run: open -Fn "$(xcode-select --print-path)/Applications/Simulator.app" @@ -66,17 +75,7 @@ jobs: xcrun simctl install $udid $PREBUILT_WDA_PATH xcrun simctl launch $udid "com.facebook.WebDriverAgentRunner.xctrunner" name: Install and launch WDA on Simulator - - - - run: | - release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) - asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) - ios_app=$(echo "$asset_urls" | tail -n 1) - echo "$ios_app" - curl -LO "$ios_app" - echo "APP_PATH=$(pwd)/ios.zip" >> $GITHUB_ENV - name: Download sample iOS app - + - run: | mkdir -p appium-logs UDID=$udid APP_PATH=$APP_PATH npm run wdio-ios | tee appium-logs/logs.txt From 66d9b7b675bac62da3f78e880b5a58bce9a2955b Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Thu, 18 Sep 2025 22:18:52 +0530 Subject: [PATCH 17/19] try curl Co-authored-by: SrinivasanTarget --- .github/workflows/appium3_ios.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index 02500cb..dbd9459 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -31,6 +31,7 @@ jobs: run: brew install jq - run: | + curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest ios_app=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest | jq -r '.assets[] | select(.name=="ios.zip") | .browser_download_url') echo "Downloading from: $ios_app" curl -LO "$ios_app" From bf93a29dc8f25d2141a81829fa2966462e4383b3 Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Fri, 19 Sep 2025 07:56:11 +0530 Subject: [PATCH 18/19] Run all tests Co-authored-by: SrinivasanTarget --- .circleci/config.yml | 135 ------------------ ...pium3._androidyml => appium3._android.yml} | 10 +- .github/workflows/appium3_ios.yml | 2 +- test/specs/test.e2e.js | 2 +- 4 files changed, 8 insertions(+), 141 deletions(-) delete mode 100644 .circleci/config.yml rename .github/workflows/{appium3._androidyml => appium3._android.yml} (99%) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a976544..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,135 +0,0 @@ -# # Use the latest 2.1 version of CircleCI pipeline process engine. -# # See: https://circleci.com/docs/configuration-reference - -# # For a detailed guide to building and testing on iOS, read the docs: -# # https://circleci.com/docs/testing-ios/ -# on: -# pull_request: -# types: [opened, reopened] -# version: 2.1 - -# # Define a job to be invoked later in a workflow. -# # See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs -# jobs: -# WDIO_IOS: -# # Specify the execution environment. -# # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job -# macos: -# # Specify the Xcode version you desire here -# # See: https://circleci.com/docs/using-macos/ -# xcode: 15.2.0 - -# # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps -# steps: -# # Checkout the code as the first step. -# - checkout -# - run: xcrun simctl list devices available -# - run: -# name: Node Version -# command: | -# nvm install v22.2.0 && nvm alias default 22.2.0 -# - run: -# name: Install Appium and Run iOS Test -# command: | -# release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) -# asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) -# ios_app=$(echo "$asset_urls" | tail -n 1) -# echo "$ios_app" -# curl -LO $ios_app -# echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV -# echo $pwd -# echo ls -# nvm install v22.2.0 && nvm alias default 22.2.0 -# node -v -# target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) -# echo $target_sim_id -# echo 'export UDID=$target_sim_id' >> $BASH_ENV -# xcrun simctl boot $target_sim_id -# xcrun simctl bootstatus $target_sim_id -b -# npm install -g appium -# npm run build-flutter-by-service -# npm install --no-package-lock -# npm run build -# appium driver list -# appium driver run xcuitest build-wda -# wda=$(ls -d /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgent*) -# echo $wda -# echo 'export WDA_PATH=$wda' >> $BASH_ENV -# echo ${WDA_PATH} -# echo ${PROJECT_ENV_VAR} -# xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app -# xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner" -# mkdir appium-logs -# UDID=$target_sim_id APP_PATH=$ios_app npm run wdio-ios - -# - store_artifacts: -# path: appium-logs -# # JAVA_IOS: -# # # Specify the execution environment. -# # # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job -# # # Add steps to the job -# # # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps -# # macos: -# # # Specify the Xcode version you desire here -# # # See: https://circleci.com/docs/using-macos/ -# # xcode: 15.2.0 -# # steps: -# # # Checkout the code as the first step. -# # - checkout -# # - run: xcrun simctl list devices available -# # - run: -# # name: Node Version -# # command: | -# # nvm install v22.2.0 && nvm alias default 22.2.0 -# # - run: -# # name: Install Appium and Run iOS Test -# # command: | -# # release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) -# # asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) -# # ios_app=$(echo "$asset_urls" | tail -n 1) -# # echo "$ios_app" -# # curl -LO $ios_app -# # echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV -# # echo $APP_PATH -# # nvm install v22.2.0 && nvm alias default 22.2.0 -# # node -v -# # target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1) -# # echo $target_sim_id -# # echo 'export UDID=$target_sim_id' >> $BASH_ENV -# # xcrun simctl boot $target_sim_id -# # xcrun simctl bootstatus $target_sim_id -b -# # npm install -g appium@2.19.0 -# # npm install --no-package-lock -# # npm run build -# # appium driver list -# # appium driver run xcuitest build-wda -# # wda=$(ls -d /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgent*) -# # echo $wda -# # echo 'export WDA_PATH=$wda' >> $BASH_ENV -# # echo ${WDA_PATH} -# # echo ${PROJECT_ENV_VAR} -# # xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app -# # xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner" -# # mkdir appium-logs -# # git clone https://github.com/AppiumTestDistribution/flutter-finder.git -# # cd flutter-finder/flutter-by/java -# # UDID=$target_sim_id APP_PATH=$ios_app Platform=ios ./gradlew clean test --debug - -# # - store_artifacts: -# # path: flutter-finder/flutter-by/java/appium.log -# # # Orchestrate jobs using workflows -# # # See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows -# workflows: -# ios: # This is the name of the workflow, feel free to change it to better match your workflow. -# # Inside the workflow, you define the jobs you want to run. -# jobs: -# - WDIO_IOS: -# filters: -# branches: -# ignore: -# - main -# # - JAVA_IOS: -# # filters: -# # branches: -# # ignore: -# # - main diff --git a/.github/workflows/appium3._androidyml b/.github/workflows/appium3._android.yml similarity index 99% rename from .github/workflows/appium3._androidyml rename to .github/workflows/appium3._android.yml index 498428b..efe4ca3 100644 --- a/.github/workflows/appium3._androidyml +++ b/.github/workflows/appium3._android.yml @@ -1,9 +1,11 @@ +name: Appium Flutter Integration Driver with Appium 3 + on: - workflow_dispatch: - push: - branches: [ main ] + pull_request: + +env: + CI: true -name: Appium Flutter Integration Driver with Appium 3 jobs: Android_E2E_WDIO: runs-on: ubuntu-latest diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index dbd9459..13659cb 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -1,4 +1,4 @@ -name: iOS WDIO Tests +name: iOS WDIO Tests with Appium 3 on: pull_request: diff --git a/test/specs/test.e2e.js b/test/specs/test.e2e.js index d1664b1..aa95e5f 100644 --- a/test/specs/test.e2e.js +++ b/test/specs/test.e2e.js @@ -140,7 +140,7 @@ describe('My Login application', () => { }); expect(await childElement.getText()).toEqual('Child 2'); }); - it.only('Ancestor Test', async () => { + it('Ancestor Test', async () => { await performLogin(); await openScreen('Nested Scroll'); const parentElement = await browser.flutterByAncestor$({ From 9213d011f11acb23b7fe255e4959a86f21f902dd Mon Sep 17 00:00:00 2001 From: Sai Krishna V Date: Fri, 19 Sep 2025 08:46:53 +0530 Subject: [PATCH 19/19] Fetch the app version from readme for download Co-authored-by: SrinivasanTarget --- .github/workflows/appium3._android.yml | 7 ++----- .github/workflows/appium3_ios.yml | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/appium3._android.yml b/.github/workflows/appium3._android.yml index efe4ca3..61f0535 100644 --- a/.github/workflows/appium3._android.yml +++ b/.github/workflows/appium3._android.yml @@ -26,12 +26,9 @@ jobs: - name: 'List files' run: | - release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) - asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) - android_app=$(echo "$asset_urls" | head -n 1) + version=$(grep 'appium_flutter_server:' README.md | awk '{print $2}') + android_app="https://github.com/AppiumTestDistribution/appium-flutter-server/releases/download/$version/app-debug.apk" echo "$android_app" - ios_app=$(echo "$asset_urls" | tail -n 1) - echo "$ios_app" curl -LO $android_app ls ${{ github.workspace }} echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV diff --git a/.github/workflows/appium3_ios.yml b/.github/workflows/appium3_ios.yml index 13659cb..f9cc41c 100644 --- a/.github/workflows/appium3_ios.yml +++ b/.github/workflows/appium3_ios.yml @@ -31,8 +31,8 @@ jobs: run: brew install jq - run: | - curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest - ios_app=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest | jq -r '.assets[] | select(.name=="ios.zip") | .browser_download_url') + version=$(grep 'appium_flutter_server:' README.md | awk '{print $2}') + ios_app="https://github.com/AppiumTestDistribution/appium-flutter-server/releases/download/$version/ios.zip" echo "Downloading from: $ios_app" curl -LO "$ios_app" echo "APP_PATH=$(pwd)/ios.zip" >> $GITHUB_ENV