Noob_test/scripts/generate_allure_report.ps1
2026-04-06 14:06:27 +03:00

28 lines
1.3 KiB
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Запуск тестов с записью результатов Allure и генерация HTML-отчёта (нужен Allure CLI в PATH).
# Установка Allure 2: https://github.com/allure-framework/allure2/releases
# Добавьте bin каталог разархивированного allure в переменную PATH.
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot
Set-Location $Root
$venvPy = Join-Path $Root ".venv\Scripts\python.exe"
if (-not (Test-Path $venvPy)) {
Write-Error "Нет виртуального окружения .venv. Выполните: python -m venv .venv && .\.venv\Scripts\python -m pip install -r requirements.txt"
}
& $venvPy -m pytest tests\TesFindPlaceInfo.py -v
$allure = Get-Command allure -ErrorAction SilentlyContinue
if (-not $allure) {
Write-Host ""
Write-Host "Allure CLI не найден в PATH. Установите Allure 2 и добавьте bin в PATH."
Write-Host "Сырые результаты уже в папке: allure-results"
Write-Host "После установки CLI выполните: allure generate allure-results -o allure-report --clean"
exit 0
}
& allure generate allure-results -o allure-report --clean
Write-Host ""
Write-Host "Отчёт: file:///$((Join-Path $Root 'allure-report\index.html') -replace '\\', '/')"