Skip to content

Commit

Permalink
clone and run wdio-android test
Browse files Browse the repository at this point in the history
  • Loading branch information
saikrishna321 committed Jul 12, 2024
1 parent c943ac1 commit fb2c0cb
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 66 deletions.
132 changes: 66 additions & 66 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
# 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/
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:
build:
# 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

# Add steps to the job
# 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 v20.2.0 && nvm alias default 20.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"
nvm install v20.2.0 && nvm alias default 20.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 ci
npm run build
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

# 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:
- build
## 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/
#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:
# build:
# # 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
#
# # Add steps to the job
# # 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 v20.2.0 && nvm alias default 20.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"
# nvm install v20.2.0 && nvm alias default 20.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 ci
# npm run build
# 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
#
## 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:
# - build
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ jobs:
run: |
npm install
npm run prettier-check
- name: Build Driver
run: |
npm run build
- name: Checkout Test from Flutter Finder
uses: actions/checkout@v2
with:
repository: AppiumTestDistribution/flutter-finder
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: ${{ github.workspace }}/flutter-by/wdio-flutter-by-service
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
Expand All @@ -63,6 +71,9 @@ jobs:
npm install -g appium
npm install
npm run build
echo ${{ github.workspace }}
appium driver install uiautomator2
appium driver install --source=local ${{ github.workspace }}/appium-flutter-integration-driver
appium driver list
mkdir ${{ github.workspace }}/appium-logs
adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt &
Expand Down

0 comments on commit fb2c0cb

Please sign in to comment.