Skip to content

[241120] add appium github action #1

[241120] add appium github action

[241120] add appium github action #1

name: Run Selenium And Appium Tests
on:
push:
branches:
- main
jobs:
selenium-appium-tests:
runs-on: ubuntu-latest
services:
appium:
image: appium/appium
ports:
- 4723:4723
options: --entrypoint=appium
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo "ENV=production" >> $GITHUB_ENV
echo "APP_DIR=/app/Config/kbl.apk" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r web/requirements.txt
- name: Install Chrome
run: |
set -ex
sudo apt-get update -y
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
sudo apt-get install -y -f
- name: Setup ChromeDriver
run: |
wget https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/linux64/chromedriver-linux64.zip
unzip chromedriver-linux64.zip
sudo mv ./chromedriver-linux64/chromedriver /usr/local/bin/
sudo chmod +x /usr/local/bin/chromedriver
- name: Setup Xvfb
run: |
sudo apt-get install -y xvfb
Xvfb :99 -screen 0 1024x768x24 &
export DISPLAY=:99
- name: Run Selenium Tests
run: |
mkdir -p /tmp/selenium/user-data-dir
python -m unittest web/Tests/main_test.py
- name: Run Appium Tests
run: |
python -m unittest app/Tests/main_test.py