-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_coverage_report.ps1
24 lines (18 loc) · 1.13 KB
/
generate_coverage_report.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Pasta onde o relatório será gerado
$reportPath = ".\coverage"
# Executa o testes e2e
# Executa o testes e2e
py -m pytest --env=local __tests__/.frontend_angular --browser chromium --junitxml=./coverage/frontend_angular_reporter.xml --html=./coverage/frontend_angular_index.html --no-header
py -m pytest --env=local __tests__/.backend --browser chromium --junitxml=./coverage/backend_reporter.xml --html=./coverage/backend_index.html --no-header
py -m pytest --env=local __tests__/.frontend_react --browser chromium --junitxml=./coverage/frontend_react_reporter.xml --html=./coverage/frontend_react_index.html --no-header
py .\merge_reports.py
# Encontra o diretório mais recente se for existente
$latestDir = Get-ChildItem -Directory -Path $reportPath | Sort-Object LastWriteTime -Descending | Select-Object -First 1
# Verifica se encontrou um diretório e, em caso afirmativo, obtém o nome do diretório (GUID)
if ($latestDir -ne $null) {
# Abre a página index.html no navegador padrão do sistema operacional
Invoke-Item $reportPath\combined_index.html
}
else {
Write-Host "Nenhum diretório de resultados encontrado."
}