Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# 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 [email protected]
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 [email protected]
# 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
91 changes: 0 additions & 91 deletions .github/workflows/appium3_ios.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Appium Flutter Integration Driver with Appium 3

on:
pull_request:

env:
CI: true
pull_request:

name: Appium Flutter Integration Driver
jobs:
Android_E2E_WDIO:
runs-on: ubuntu-latest
Expand All @@ -26,15 +22,18 @@ jobs:

- name: 'List files'
run: |
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"
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
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
Expand All @@ -50,7 +49,7 @@ jobs:
npm run build
- name: Install Drivers
run: |
npm install -g appium
npm install -g appium@2.19.0
appium driver list
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 20
- run: npm install --no-package-lock
name: Install dependencies
- run: npm run build
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@
"webdriverio": "9.19.2"
},
"peerDependencies": {
"appium": "^3.0.0"
"appium": "^2.5.4"
},
"dependencies": {
"@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",
"@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",
"async-retry": "^1.3.3",
"asyncbox": "^3.0.0",
"bluebird": "^3.7.2",
Expand Down
2 changes: 1 addition & 1 deletion src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export class AppiumFlutterDriver extends BaseDriver<FlutterDriverConstraints> {
// @ts-ignore
await this.proxydriver.adb.removePortForward(this.flutterPort);
}
await this.proxydriver?.deleteSession(this.sessionId);
await this.proxydriver?.deleteSession();
await super.deleteSession();
}

Expand Down
6 changes: 3 additions & 3 deletions src/iOS.ts
Original file line number Diff line number Diff line change
@@ -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<XCUITestDriver> {
this.log.info(`Starting an IOS proxy session`);
const iosdriver = new XCUITestDriver({} as XCUITestDriverOpts);
await iosdriver.createSession.apply(iosdriver, args);
const iosdriver = new XCUITestDriver({} as InitialOpts);
await iosdriver.createSession(...args);
return iosdriver;
}

Expand Down
2 changes: 1 addition & 1 deletion wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
],
Expand Down