mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 11:20:13 +01:00
71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
name: Selenium UI Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
selenium-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
repository: omriza5/wekan-selenium
|
|
token: ${{ secrets.UI_TESTING_GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.13'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Install Chrome & ChromeDriver
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y wget unzip xvfb libxi6 libgbm-dev libnss3 libxshmfence1 libasound2t64
|
|
|
|
# Download and install latest stable Google Chrome
|
|
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
sudo apt install -y ./google-chrome-stable_current_amd64.deb
|
|
|
|
# Get Chrome version number like "139.0.7258.66"
|
|
CHROME_VERSION=$(google-chrome --version | grep -oP "\d+\.\d+\.\d+\.\d+")
|
|
|
|
# Download matching ChromeDriver from official "chrome-for-testing" bucket (preferred)
|
|
wget -q -O chromedriver.zip "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROME_VERSION}/linux64/chromedriver-linux64.zip"
|
|
|
|
# Unzip ChromeDriver, then move binary correctly (handles folder name)
|
|
unzip chromedriver.zip
|
|
mv */chromedriver /usr/local/bin/chromedriver
|
|
sudo chmod +x /usr/local/bin/chromedriver
|
|
|
|
# Clean up
|
|
rm -rf chromedriver.zip google-chrome-stable_current_amd64.deb
|
|
|
|
# Create temporary directories for Chrome user data
|
|
mkdir -p /tmp/chrome-user-data
|
|
chmod 755 /tmp/chrome-user-data
|
|
|
|
- name: Cleanup existing Chrome processes
|
|
run: |
|
|
# Kill any existing Chrome processes
|
|
pkill -f chrome || true
|
|
pkill -f chromedriver || true
|
|
# Clean up any existing user data directories
|
|
rm -rf /tmp/chrome-user-data-* || true
|
|
|
|
- name: Run Selenium tests
|
|
env:
|
|
HEADLESS: true
|
|
WEKAN_URL: http://${{ secrets.WEKAN_URL }}:80
|
|
run: |
|
|
pytest tests/ -v
|