Skip to content

Commit 67503e4

Browse files
committed
add coverage
1 parent 595aa39 commit 67503e4

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
run: |
1919
python -m pip install --upgrade pip
2020
pip install -r requirements.txt
21+
pip install pytest-cov # Agregado para coverage
2122
- name: Install GeckoDriver
2223
run: |
2324
python -m pip install webdriver-manager
@@ -52,3 +53,18 @@ jobs:
5253
with:
5354
name: html-report
5455
path: reports/report.html
56+
- name: Run tests with Coverage
57+
env:
58+
PYTHONPATH: .
59+
run: |
60+
pytest test/ --cov=pages --cov-report=xml:coverage.xml --cov-report=html:htmlcov
61+
- name: Upload Coverage HTML report
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: coverage-html-report
65+
path: htmlcov/
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@v3
68+
with:
69+
file: ./coverage.xml
70+
fail_ci_if_error: true

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pytest==8.4.2
33
pytest-html==4.1.1
44
webdriver-manager==4.0.2
55
allure-pytest== 2.15.0
6+
pytest-cov== 7.0.0

test/reports/report.html

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)