Subindo relatório de testes #32
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: Newman Tests with HTML Report | |
on: [push] | |
jobs: | |
run-newman-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' # Altere para '20' se necessário | |
- name: Install Newman and HTML Extra Reporter | |
run: npm install -g newman newman-reporter-htmlextra | |
- name: Create report directory | |
run: mkdir -p ./relatórios | |
- name: Debug information before Newman run | |
run: | | |
echo "Node.js version:" | |
node -v | |
echo "NPM version:" | |
npm -v | |
echo "Installed Newman version:" | |
newman -v | |
echo "Repository contents:" | |
ls -la | |
echo "Current directory contents:" | |
ls -la | |
- name: Run Newman tests | |
run: | | |
newman run servRest.postman_collection.json -e servRest_test.postman_environment.json -r htmlextra --reporter-htmlextra-export ./relatórios/Relatório_ServRest.html --reporter-htmlextra-title "Relatório API_Serv_Rest_Automation" --reporter-htmlextra-titleSize 7 --reporter-htmlextra-showEnvironmentData | |
continue-on-error: true | |
- name: Debug information after Newman run | |
run: | | |
echo "Contents of relatórios directory:" | |
ls -la ./relatórios | |
- name: Display Newman logs if failed | |
if: failure() | |
run: | | |
echo "Newman run failed. Displaying logs..." | |
cat ./relatórios/Relatório_ServRest.html |