Framework Mode - Test result publishing
Folder Structure
project-root/
├── tests/
│ ├── test_example.py
│ └── conftest.py
├── reports/
│ └── latest_report.html
├── pytest.ini
├── requirements.txt
└── ci/
└── pipeline.yml
project-root/
├── tests/
│ ├── test_example.py
│ └── conftest.py
├── reports/
│ └── latest_report.html
├── pytest.ini
├── requirements.txt
└── ci/
└── pipeline.yml
tests/.conftest.py holds reusable setup code and fixtures for tests.reports/.pytest.ini configures pytest options like markers and report formats.ci/ automate test runs and publish reports.Use pytest.ini to set default options, for example:
[pytest]
addopts = --html=reports/latest_report.html --self-contained-html --junitxml=reports/results.xml
markers =
smoke: Quick smoke tests
regression: Full regression suite
Manage environments and credentials via environment variables or separate config files loaded in conftest.py.
Example: Use os.environ in fixtures to select test environment or browser.
pytest-html plugin for easy visual results.JUnit format) for CI tools like Jenkins, GitHub Actions.reports/ folder for easy access and archiving.ci/pipeline.yml) runs tests, collects reports, and publishes them as build artifacts or uploads to dashboards.reports/latest_report.html as an artifact.reports/ for easy retrieval.--self-contained-html to avoid missing resources.Where in this folder structure would you add a new pytest plugin configuration to generate a JSON test report?