fix and add som usecases

This commit is contained in:
2025-09-15 17:41:07 +08:00
parent 838806b9e3
commit 414737fd48
37 changed files with 1133 additions and 51 deletions

20
conftest.py Normal file
View File

@@ -0,0 +1,20 @@
import pytest
import yaml
@pytest.fixture(scope="session")
def env_config():
# A fixture to read the config file once per session.
# In a real-world scenario, you might add logic here to select
# different config files (e.g., dev, prod) based on a command-line argument.
with open('config/dev_env.yaml', 'r') as file:
return yaml.safe_load(file)
@pytest.fixture(scope="session")
def base_url(env_config):
"""
Provides the base URL for the application under test.
"""
url = env_config.get('base_url')
if not url:
raise Exception("'base_url' not found in config file.")
return url