Python Selenium Tests with Allure Reports #5
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: Python Selenium Tests with Allure Reports | |
on: | |
workflow_dispatch: | |
inputs: | |
deployment_target: | |
description: "Choose test set" | |
required: true | |
type: choice | |
default: smoke | |
options: | |
- smoke | |
- regression | |
- all | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
name: Run Selenium Tests and Generate Allure Reports | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11.1' | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Install Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install Allure | |
run: | | |
sudo wget -q https://github.com/allure-framework/allure2/releases/download/2.30.0/allure-2.30.0.tgz | |
sudo tar -zxvf allure-2.30.0.tgz -C /opt/ | |
sudo ln -s /opt/allure-2.30.0/bin/allure /usr/local/bin/allure | |
- name: Run all tests | |
if: github.event.inputs.deployment_target == 'all' | |
run: pytest --alluredir=allure-results | |
- name: Run smoke tests | |
if: github.event.inputs.deployment_target == 'smoke' | |
run: pytest -m smoke --alluredir=allure-results | |
- name: Run regression tests | |
if: github.event.inputs.deployment_target == 'regression' | |
run: pytest -m regression --alluredir=allure-results | |
- name: Add Executor And Categories in Allure Results | |
run: cp -r categories.json executor.json allure-results/ | |
- name: Generate Report | |
run: allure generate allure-results --clean -o allure-report | |
- name: Save Allure Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: allure-report | |
path: allure-report | |
retention-days: 1 |