Skip to content

Commit d0d7cfc

Browse files
Move ios CI to github actions
Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
1 parent 59c36f5 commit d0d7cfc

4 files changed

Lines changed: 184 additions & 91 deletions

File tree

.circleci/config.yml

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,25 @@
1-
# Use the latest 2.1 version of CircleCI pipeline process engine.
2-
# See: https://circleci.com/docs/configuration-reference
1+
# # Use the latest 2.1 version of CircleCI pipeline process engine.
2+
# # See: https://circleci.com/docs/configuration-reference
33

4-
# For a detailed guide to building and testing on iOS, read the docs:
5-
# https://circleci.com/docs/testing-ios/
6-
on:
7-
pull_request:
8-
types: [opened, reopened]
9-
version: 2.1
4+
# # For a detailed guide to building and testing on iOS, read the docs:
5+
# # https://circleci.com/docs/testing-ios/
6+
# on:
7+
# pull_request:
8+
# types: [opened, reopened]
9+
# version: 2.1
1010

11-
# Define a job to be invoked later in a workflow.
12-
# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs
13-
jobs:
14-
WDIO_IOS:
15-
# Specify the execution environment.
16-
# See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job
17-
macos:
18-
# Specify the Xcode version you desire here
19-
# See: https://circleci.com/docs/using-macos/
20-
xcode: 15.2.0
21-
22-
# See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps
23-
steps:
24-
# Checkout the code as the first step.
25-
- checkout
26-
- run: xcrun simctl list devices available
27-
- run:
28-
name: Node Version
29-
command: |
30-
nvm install v22.2.0 && nvm alias default 22.2.0
31-
- run:
32-
name: Install Appium and Run iOS Test
33-
command: |
34-
release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest)
35-
asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4)
36-
ios_app=$(echo "$asset_urls" | tail -n 1)
37-
echo "$ios_app"
38-
curl -LO $ios_app
39-
echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV
40-
echo $pwd
41-
echo ls
42-
nvm install v22.2.0 && nvm alias default 22.2.0
43-
node -v
44-
target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1)
45-
echo $target_sim_id
46-
echo 'export UDID=$target_sim_id' >> $BASH_ENV
47-
xcrun simctl boot $target_sim_id
48-
xcrun simctl bootstatus $target_sim_id -b
49-
npm install -g appium
50-
npm run build-flutter-by-service
51-
npm install --no-package-lock
52-
npm run build
53-
appium driver list
54-
appium driver run xcuitest build-wda
55-
wda=$(ls -d /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgent*)
56-
echo $wda
57-
echo 'export WDA_PATH=$wda' >> $BASH_ENV
58-
echo ${WDA_PATH}
59-
echo ${PROJECT_ENV_VAR}
60-
xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app
61-
xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner"
62-
mkdir appium-logs
63-
UDID=$target_sim_id APP_PATH=$ios_app npm run wdio-ios
64-
65-
- store_artifacts:
66-
path: appium-logs
67-
# JAVA_IOS:
11+
# # Define a job to be invoked later in a workflow.
12+
# # See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs
13+
# jobs:
14+
# WDIO_IOS:
6815
# # Specify the execution environment.
6916
# # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job
70-
# # Add steps to the job
71-
# # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps
7217
# macos:
7318
# # Specify the Xcode version you desire here
7419
# # See: https://circleci.com/docs/using-macos/
7520
# xcode: 15.2.0
21+
22+
# # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps
7623
# steps:
7724
# # Checkout the code as the first step.
7825
# - checkout
@@ -90,15 +37,17 @@ jobs:
9037
# echo "$ios_app"
9138
# curl -LO $ios_app
9239
# echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV
93-
# echo $APP_PATH
40+
# echo $pwd
41+
# echo ls
9442
# nvm install v22.2.0 && nvm alias default 22.2.0
9543
# node -v
9644
# target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1)
9745
# echo $target_sim_id
9846
# echo 'export UDID=$target_sim_id' >> $BASH_ENV
9947
# xcrun simctl boot $target_sim_id
10048
# xcrun simctl bootstatus $target_sim_id -b
101-
# npm install -g appium@2.19.0
49+
# npm install -g appium
50+
# npm run build-flutter-by-service
10251
# npm install --no-package-lock
10352
# npm run build
10453
# appium driver list
@@ -111,25 +60,76 @@ jobs:
11160
# xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app
11261
# xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner"
11362
# mkdir appium-logs
114-
# git clone https://github.com/AppiumTestDistribution/flutter-finder.git
115-
# cd flutter-finder/flutter-by/java
116-
# UDID=$target_sim_id APP_PATH=$ios_app Platform=ios ./gradlew clean test --debug
63+
# UDID=$target_sim_id APP_PATH=$ios_app npm run wdio-ios
11764

11865
# - store_artifacts:
119-
# path: flutter-finder/flutter-by/java/appium.log
120-
# # Orchestrate jobs using workflows
121-
# # See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows
122-
workflows:
123-
ios: # This is the name of the workflow, feel free to change it to better match your workflow.
124-
# Inside the workflow, you define the jobs you want to run.
125-
jobs:
126-
- WDIO_IOS:
127-
filters:
128-
branches:
129-
ignore:
130-
- main
131-
# - JAVA_IOS:
132-
# filters:
133-
# branches:
134-
# ignore:
135-
# - main
66+
# path: appium-logs
67+
# # JAVA_IOS:
68+
# # # Specify the execution environment.
69+
# # # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job
70+
# # # Add steps to the job
71+
# # # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps
72+
# # macos:
73+
# # # Specify the Xcode version you desire here
74+
# # # See: https://circleci.com/docs/using-macos/
75+
# # xcode: 15.2.0
76+
# # steps:
77+
# # # Checkout the code as the first step.
78+
# # - checkout
79+
# # - run: xcrun simctl list devices available
80+
# # - run:
81+
# # name: Node Version
82+
# # command: |
83+
# # nvm install v22.2.0 && nvm alias default 22.2.0
84+
# # - run:
85+
# # name: Install Appium and Run iOS Test
86+
# # command: |
87+
# # release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest)
88+
# # asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4)
89+
# # ios_app=$(echo "$asset_urls" | tail -n 1)
90+
# # echo "$ios_app"
91+
# # curl -LO $ios_app
92+
# # echo 'export APP_PATH=$CIRCLE_WORKING_DIRECTORY/ios.zip' >> $BASH_ENV
93+
# # echo $APP_PATH
94+
# # nvm install v22.2.0 && nvm alias default 22.2.0
95+
# # node -v
96+
# # target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14" | cut -d "(" -f2 | cut -d ")" -f1 | head -n 1)
97+
# # echo $target_sim_id
98+
# # echo 'export UDID=$target_sim_id' >> $BASH_ENV
99+
# # xcrun simctl boot $target_sim_id
100+
# # xcrun simctl bootstatus $target_sim_id -b
101+
# # npm install -g appium@2.19.0
102+
# # npm install --no-package-lock
103+
# # npm run build
104+
# # appium driver list
105+
# # appium driver run xcuitest build-wda
106+
# # wda=$(ls -d /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgent*)
107+
# # echo $wda
108+
# # echo 'export WDA_PATH=$wda' >> $BASH_ENV
109+
# # echo ${WDA_PATH}
110+
# # echo ${PROJECT_ENV_VAR}
111+
# # xcrun simctl install $target_sim_id $wda/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app
112+
# # xcrun simctl launch $target_sim_id "com.facebook.WebDriverAgentRunner.xctrunner"
113+
# # mkdir appium-logs
114+
# # git clone https://github.com/AppiumTestDistribution/flutter-finder.git
115+
# # cd flutter-finder/flutter-by/java
116+
# # UDID=$target_sim_id APP_PATH=$ios_app Platform=ios ./gradlew clean test --debug
117+
118+
# # - store_artifacts:
119+
# # path: flutter-finder/flutter-by/java/appium.log
120+
# # # Orchestrate jobs using workflows
121+
# # # See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows
122+
# workflows:
123+
# ios: # This is the name of the workflow, feel free to change it to better match your workflow.
124+
# # Inside the workflow, you define the jobs you want to run.
125+
# jobs:
126+
# - WDIO_IOS:
127+
# filters:
128+
# branches:
129+
# ignore:
130+
# - main
131+
# # - JAVA_IOS:
132+
# # filters:
133+
# # branches:
134+
# # ignore:
135+
# # - main
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
on:
2-
pull_request:
2+
workflow_dispatch:
3+
push:
4+
branches: [ main ]
35

46
name: Appium Flutter Integration Driver with Appium 3
57
jobs:

.github/workflows/appium3_ios.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: iOS WDIO Tests
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
CI: true
8+
SHOW_XCODE_LOG: true
9+
PREBUILT_WDA_PATH: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
10+
11+
jobs:
12+
wdio_ios:
13+
runs-on: macos-14
14+
name: WDIO iOS (Xcode 15.4)
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Node.js 22.x
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '22.x'
22+
23+
- name: Select Xcode 15.4
24+
uses: maxim-lobanov/setup-xcode@v1
25+
with:
26+
xcode-version: '15.4'
27+
28+
- name: List Installed Simulators
29+
run: xcrun simctl list devices available
30+
31+
- name: Start iOS Simulator UI
32+
run: open -Fn "$(xcode-select --print-path)/Applications/Simulator.app"
33+
34+
- name: Boot simulator
35+
id: boot_sim
36+
uses: futureware-tech/simulator-action@v4
37+
with:
38+
model: 'iPhone 14'
39+
os_version: '17.5'
40+
shutdown_after_job: false
41+
wait_for_boot: true
42+
43+
- name: Capture UDID
44+
id: udid
45+
run: |
46+
target_sim_id=$(xcrun simctl list devices available | grep "iPhone 14 (17.5)" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -n 1)
47+
echo "udid=$target_sim_id" >> $GITHUB_OUTPUT
48+
49+
- name: Install Appium and deps
50+
run: |
51+
npm install -g appium
52+
npm ci
53+
npm run build-flutter-by-service
54+
npm run build
55+
56+
- name: Build WDA with XCUITest driver
57+
run: |
58+
appium driver list
59+
appium driver doctor xcuitest
60+
appium driver run xcuitest download-wda-sim --platform=ios --outdir=$(dirname "$PREBUILT_WDA_PATH")
61+
echo "WDA path: $PREBUILT_WDA_PATH"
62+
echo "WDA_PATH=$PREBUILT_WDA_PATH" >> $GITHUB_ENV
63+
64+
- name: Install and launch WDA on Simulator
65+
run: |
66+
xcrun simctl install "${{ steps.udid.outputs.udid }}" "$PREBUILT_WDA_PATH/WebDriverAgentRunner-Runner.app"
67+
xcrun simctl launch "${{ steps.udid.outputs.udid }}" "com.facebook.WebDriverAgentRunner.xctrunner"
68+
69+
- name: Download sample iOS app
70+
run: |
71+
release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest)
72+
asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4)
73+
ios_app=$(echo "$asset_urls" | tail -n 1)
74+
echo "$ios_app"
75+
curl -LO "$ios_app"
76+
echo "APP_PATH=$(pwd)/ios.zip" >> $GITHUB_ENV
77+
78+
- name: Run WDIO iOS
79+
env:
80+
UDID: ${{ steps.udid.outputs.udid }}
81+
APP_PATH: ${{ env.APP_PATH }}
82+
run: |
83+
mkdir -p appium-logs
84+
UDID=$UDID APP_PATH=$APP_PATH npm run wdio-ios | tee appium-logs/logs.txt
85+
86+
- name: Upload logs
87+
if: ${{ always() }}
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: appium-logs
91+
path: appium-logs

test/specs/test.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('My Login application', () => {
140140
});
141141
expect(await childElement.getText()).toEqual('Child 2');
142142
});
143-
it('Ancestor Test', async () => {
143+
it.only('Ancestor Test', async () => {
144144
await performLogin();
145145
await openScreen('Nested Scroll');
146146
const parentElement = await browser.flutterByAncestor$({

0 commit comments

Comments
 (0)