Refactor API and UI test workflows to improve readability and consistency; update base URL retrieval to use environment variable for flexibility

This commit is contained in:
omri zaher 2025-08-11 11:44:56 +03:00
parent 6b3560c8d3
commit 97fb01f3bc
4 changed files with 19 additions and 7 deletions

View file

@ -1,25 +1,35 @@
name: Run Tests with coverage
name: Run API Tests
on:
pull_request:
branches:
- main
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Set up Python
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: pytest
# Step 4: Run API tests
- name: Run API tests
env:
BASE_URL: ${{ secrets.BASE_URL }} # Example: Pass API base URL as a secret
run: |
pytest --maxfail=5 --disable-warnings -v

View file

@ -1,4 +1,4 @@
name: Selenium UI Tests
name: Run UI Tests
on:
pull_request:

View file

@ -1,6 +1,7 @@
import os
import requests
base_url = "http://10.0.0.17"
base_url = os.environ.get("WEKAN_URL", "http://localhost")
class TestLogin:
def test_health_check(self):

View file

@ -1,7 +1,8 @@
import pytest
import requests
import os
base_url = "http://10.0.0.17"
base_url = os.environ.get("WEKAN_URL", "http://localhost")
class TestBoard:
@pytest.fixture(scope="class", autouse=True)