Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appium Android Github Action Test #1109

Open
wants to merge 25 commits into
base: service_rewrite_2023
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c8a8a9f
add appium packages
jiji14 Nov 9, 2023
b0faa75
add webdriverIO setting for local e2e test
jiji14 Nov 9, 2023
6a64e6d
add appium capabilities config for IOS
jiji14 Nov 9, 2023
22ea874
add sample test file
jiji14 Nov 9, 2023
6c70b16
Change sample test to check if wdio successfully connects to simulator
jiji14 Nov 9, 2023
c141f8a
Add android test setting
jiji14 Nov 10, 2023
bfa1bd3
add Android selector and detect if device is android or ios
jiji14 Nov 10, 2023
725257d
change config we can set deviceName and platformVersion dynamically
jiji14 Nov 10, 2023
95ffe34
Apply prettier to e2e-tests directory
jiji14 Nov 10, 2023
3dd4e17
Merge remote-tracking branch 'upstream/master' into appium-setting
jiji14 Nov 10, 2023
8333934
Merge branch 'appium-setting' of https://github.com/jiji14/e-mission-…
jiji14 Nov 10, 2023
6e33899
sample test error fix
jiji14 Nov 10, 2023
4656813
Add appium driver package for Android
jiji14 Nov 10, 2023
ee9a58f
Change get deviceName and platformVersion logic
jiji14 Nov 13, 2023
0f0930b
Add appium test script
jiji14 Nov 13, 2023
25bfdd5
Merge branch 'service_rewrite_2023' into appium-setting
jiji14 Nov 16, 2023
161bbbd
change IOS testing setup to download devapp when starting tests
jiji14 Nov 17, 2023
fb9e47f
add android test on workflow
jiji14 Nov 27, 2023
9c73379
Change workflow setting temporaily for test
jiji14 Nov 27, 2023
d131875
Combine testing steps
jiji14 Nov 27, 2023
5afb5ce
Merge branch 'appium-setting' into appium-android-github-action
jiji14 Nov 27, 2023
023d7b9
change apk directory
jiji14 Nov 27, 2023
1579bcc
Check config file
jiji14 Nov 27, 2023
a9a8390
change directory and check if it has config file
jiji14 Nov 27, 2023
4754420
Run wdio in e2etests directory
jiji14 Nov 27, 2023
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
60 changes: 46 additions & 14 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a basic workflow to help you get started with Actions
# This is a basic workflow to help you get started with Actions

name: osx-build-android

Expand All @@ -10,9 +10,7 @@ on:
- master
- maint_upgrade_**
pull_request:
branches:
- master
- maint_upgrade_**

schedule:
# * is a special character in YAML so you have to quote this string
- cron: '5 4 * * 0'
Expand Down Expand Up @@ -65,16 +63,50 @@ jobs:
echo "gradle version"
gradle -version

- name: Build android
# - name: Build android
# shell: bash -l {0}
# run: |
# echo $PATH
# which gradle
# gradle -version
# echo "Let's rerun the activation"
# source setup/activate_native.sh
# export JAVA_HOME=$JAVA_HOME_11_X64
# echo $PATH
# which gradle
# gradle --version
# npx cordova build android

# - name: set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: '11'
# distribution: 'temurin'
# cache: gradle

# - name: Android Emulator Runner
# uses: ReactiveCircus/android-emulator-runner@v2
# with:
# working-directory: ./platforms/android
# api-level: 26
# target: google_apis
# arch: x86_64
# ndk: 21.0.6113669
# cmake: 3.10.2.4988404
# script: ./gradlew connectedCheck --status

- name: Run appium server
shell: bash -l {0}
timeout-minutes: 10
run: |
echo $PATH
which gradle
gradle -version
echo "Let's rerun the activation"
source setup/activate_native.sh
export JAVA_HOME=$JAVA_HOME_11_X64
echo $PATH
which gradle
gradle --version
npx cordova build android
npx appium --version
npx wdio --version
npx appium &>/dev/null &
sleep 10
echo "Change directory"
cd e2e-tests/config
echo "Run webDriverIO"
npx wdio android.config.js


3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ www/json
# This is the pattern to check only www directory
# Ignore all
/*
# but don't ignore all the files in www directory
# but don't ignore all the files in www and e2e-tests directory
!/www
!/e2e-tests
20 changes: 20 additions & 0 deletions e2e-tests/config/android.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { getDeviceName, getPlatformVersion } = require('./common');
const { config } = require('./wdio.conf');
const { join } = require('path');

config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'Android',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here
// http://appium.io/docs/en/writing-running-appium/caps/
'appium:deviceName': getDeviceName('Android'),
'appium:platformVersion': getPlatformVersion('Android'),
'appium:automationName': 'UiAutomator2',
'appium:app': join(process.cwd(), './platforms/android/app/build/outputs/apk/debug/app-debug.apk'),
},
];

exports.config = config;
21 changes: 21 additions & 0 deletions e2e-tests/config/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* get Device Name from script
* @param platform iOS or Android
*/
const getDeviceName = (platform) => {
const deviceName = process.argv.find((arg) => arg.includes('--deviceName'));
const defaultDeviceName = platform === 'iOS' ? 'iPhone 13' : 'Pixel 3a API 33';
return deviceName ? deviceName.split('=')[1] : defaultDeviceName;
};

/**
* get Platform Version from script
* @param platform iOS or Android
*/
const getPlatformVersion = (platform) => {
const platformVersion = process.argv.find((arg) => arg.includes('--platformVersion'));
const defaultPlatformVersion = platform === 'iOS' ? '15.0' : '13';
return platformVersion ? platformVersion.split('=')[1] : defaultPlatformVersion;
};

module.exports = { getDeviceName, getPlatformVersion };
21 changes: 21 additions & 0 deletions e2e-tests/config/ios.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { getDeviceName, getPlatformVersion } = require('./common');
const { config } = require('./wdio.conf');
const { join } = require('path');

// Appium capabilities
config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'iOS',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here
// http://appium.io/docs/en/writing-running-appium/caps/
'appium:deviceName': getDeviceName('iOS'),
'appium:platformVersion': getPlatformVersion('iOS'),
'appium:automationName': 'XCUITest',
// it may change once we finalize our target app
'appium:app': join(process.cwd(), './apps/em-devapp.app'),
},
];
exports.config = config;
Loading
Loading