use spaces #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests e2e iOS App | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
e2e-ios-app: | |
strategy: | |
matrix: | |
include: | |
- osVersion: '15.2' | |
os: 'iOS' | |
model: 'iPhone 13' | |
env: | |
CI: true | |
APPIUM_TEST_SERVER_PORT: 4723 | |
APPIUM_TEST_SERVER_HOST: 127.0.0.1 | |
APPIUM_STARTUP_TIMEOUT_SEC: 30 | |
_FORCE_LOGS: 1 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: futureware-tech/simulator-action@v2 | |
with: | |
model: ${{ matrix.model }} | |
os: ${{ matrix.os }} | |
os_version: ${{ matrix.osVersion }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- run: yarn install | |
- run: | | |
mkdir apps | |
wget https://github.com/webdriverio/native-demo-app/releases/download/v0.4.0/iOS-Simulator-NativeDemoApp-0.4.0.app.zip -P apps | |
- run: | | |
npm config set legacy-peer-deps true | |
npm install -g appium@next | |
name: Install dev dependencies | |
- run: | | |
cwd=$(pwd) | |
pushd "$cwd" | |
cd ~ | |
appium driver install xcuitest | |
appium driver install safari | |
nohup appium server \ | |
--port=$APPIUM_TEST_SERVER_PORT \ | |
--address=$APPIUM_TEST_SERVER_HOST \ | |
--relaxed-security \ | |
2>&1 > "$cwd/appium.log" & | |
popd | |
name: Start Appium server | |
- run: | | |
seconds_started=$(date +%s) | |
while ! nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; do | |
sleep 0.1 | |
seconds_elapsed=$(( $(date +%s) - seconds_started )) | |
if [[ $seconds_elapsed -gt $APPIUM_STARTUP_TIMEOUT_SEC ]]; then | |
echo "Appium server was unable to start within $APPIUM_STARTUP_TIMEOUT_SEC seconds timeout" | |
exit 1 | |
fi | |
done | |
name: Wait for Appium server startup | |
- run: yarn ios.app | |
name: Run functional tests | |
- name: Save server output | |
if: ${{ always() }} | |
uses: actions/upload-artifact@master | |
with: | |
name: appium.log | |
path: appium.log | |
- name: Show appium server output | |
if: ${{ always() }} | |
run: cat appium.log |