Merge pull request #12 from omriza5/feature/add-ui-testing-workflow

Add Selenium UI testing job with browser matrix and resolutions
This commit is contained in:
omriza5 2025-09-24 16:34:50 +03:00 committed by GitHub
commit 09282183c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -198,7 +198,7 @@ jobs:
run: |
pytest --maxfail=5 --disable-warnings -v
Selenium-ui-test:
Selenium-ui-tests:
needs: deploy
runs-on: ubuntu-latest
@ -206,9 +206,8 @@ jobs:
matrix:
browser: [chrome, firefox]
resolution:
- { name: "desktop", width: 1920, height: 1080 }
- { name: "tablet", width: 1024, height: 768 }
- { name: "mobile", width: 375, height: 667 }
- { name: "desktop", width: 1200, height: 800 }
- { name: "mobile", width: 800, height: 667 }
fail-fast: false # Continue other jobs even if one fails
name: Test ${{ matrix.browser }} - ${{ matrix.resolution.name }}
@ -218,7 +217,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1
respository: omriza5/wekan-selenium
repository: omriza5/wekan-selenium
token: ${{ secrets.UI_TESTING_GITHUB_TOKEN }}
- name: Set up Python 3.11
@ -255,6 +254,28 @@ jobs:
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
- name: Wait for Wekan to be ready
env:
WEKAN_URL: ${{ secrets.WEKAN_URL }}
run: |
echo "Waiting for Wekan to be fully ready at $WEKAN_URL..."
for i in {1..30}; do
if curl -s -f "$WEKAN_URL" > /dev/null 2>&1; then
echo "Wekan is responding! (attempt $i)"
# Additional check to ensure it's fully loaded
sleep 5
if curl -s "$WEKAN_URL" | grep -q "Wekan"; then
echo "Wekan is fully ready!"
break
fi
fi
echo "Waiting for Wekan... (attempt $i/30)"
sleep 10
done
# Final verification
curl -I "$WEKAN_URL" || exit 1
- name: Run Selenium tests
env:
HEADLESS: true
@ -262,25 +283,35 @@ jobs:
SCREEN_WIDTH: ${{ matrix.resolution.width }}
SCREEN_HEIGHT: ${{ matrix.resolution.height }}
WEKAN_URL: ${{ secrets.WEKAN_URL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
ALLURE_SUITE: "${{ matrix.browser }} - ${{ matrix.resolution.name }}"
run: |
if [ -d "allure-results" ]; then rm -rf allure-results; fi
mkdir -p allure-results
cat > allure-results/environment.properties << EOF
os_platform=$(uname -s)
os_release=$(lsb_release -r | awk '{print $2}')
os_version=$(lsb_release -c | awk '{print $2}')
python_version=$(python --version | awk '{print $2}')
Wekan.URL=http://${{ secrets.WEKAN_EC2_HOST_IP }}/
Wekan.URL=${{ secrets.WEKAN_URL }}
Headless.Mode=true
Wekan.Image=omriza5/wekan:${{ needs.deploy.outputs.wekan_image_tag }}
Browser=${{ matrix.browser }}
Resolution=${{ matrix.resolution.name }}
EOF
pytest --alluredir=allure-results tests/
- name: Upload Allure results as artifact
uses: actions/upload-artifact@v4
if: always() # Upload even if tests fail
with:
name: allure-results-${{ matrix.browser }}-${{ matrix.resolution.name }}
path: allure-results/
retention-days: 30
allure-report:
runs-on: ubuntu-latest
needs: selenium-matrix-tests
needs: Selenium-ui-tests
if: always()
steps:
@ -291,17 +322,8 @@ jobs:
uses: actions/download-artifact@v4
with:
pattern: allure-results-*
path: allure-results-downloaded
merge-multiple: false
- name: Merge all results into single directory
run: |
mkdir -p allure-results
for dir in allure-results-downloaded/*/; do
if [ -d "$dir" ]; then
cp -r "$dir"* allure-results/ 2>/dev/null || true
fi
done
path: allure-results
merge-multiple: true
- name: Generate and Deploy Allure Report
uses: simple-elf/allure-report-action@master