Skip to content

Testes de CI com Robot Framework #2

Testes de CI com Robot Framework

Testes de CI com Robot Framework #2

name: CI - Execução de Testes Automatizados
run-name: Testes de CI com Robot Framework
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
testing:
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chromium, firefox, webkit]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python 3.12.0
uses: actions/setup-python@v4
with:
python-version: '3.12.0'
- name: Install Node.js 19.1
uses: actions/setup-node@v3
with:
node-version: '19.1'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U -r requirements.txt
sudo npm install @playwright/test
sudo npx playwright install-deps
rfbrowser init
- name: Run tests
run: |
robot -d ./resultados-testes-CI -v HEADLESS:true \
-v BROWSER:${{ matrix.browser }} tests_web/tests
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}_results
path: ./resultados-testes-CI
if-no-files-found: ignore
retention-days: 2
- name: Download results
if: always()
uses: actions/download-artifact@v4
with:
name: ${{ matrix.browser }}_results
path: ./resultados/${{ matrix.browser }}
- name: Debug - Verificar arquivos baixados
if: always()
run: ls -R ./resultados/${{ matrix.browser }} || echo "Nenhum arquivo baixado!"
- name: Publicar Sumário no GitHub Actions
if: always()
run: |
echo "## 📊 Resultados dos Testes Automatizados 🚀" >> $GITHUB_STEP_SUMMARY
echo "- Navegador da execução do teste web: **${{ matrix.browser }}**" >> $GITHUB_STEP_SUMMARY
echo "- Status da execução: **${{ job.status == 'success' && '✅ Sucesso' || '❌ Falha' }}**" >> $GITHUB_STEP_SUMMARY