allure-framework / allure-framework/allure-python
Categories tab 404 error when xfail marked test is passed (with pytest.mark.xfail(strict=True))
- Ngôn ngữ chính
- Python
- Star
- 814
- Fork
- 260
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**Describe the bug**
Categories tab 404 error when xfail marked test is passed ( with pytest.mark.xfail(strict=True)
**To Reproduce**
Prepare: Run test suite (see code example below, generate report)
Steps to reproduce the behavior:
1. Open allure report
2. Click on Categories tab
3. See error: 404 Not found on page
Also js error in console:
```python
Request URL: http://10.22.33.232:55422/data/categories.json
Request Method: GET
Status Code: 200 OK
Response:
{
"uid" : "4b4757e66a1912dae1a509f688f20b0f",
"name" : "categories",
"children" : [ {
"name" : "Product defects",
"children" : [ {
"name" : "AssertionError: assert 2 == 1\n +2\n -1",
"children" : [ {
"name" : "test_failed_test",
"uid" : "b1b1f3f792fb3727",
"parentUid" : "acc8617e035d0d48b427bc2eae04aa4d",
"status" : "failed",
"time" : {
"start" : 1600590716374,
"stop" : 1600590716375,
"duration" : 1
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ ]
} ],
"uid" : "acc8617e035d0d48b427bc2eae04aa4d"
}, {
"children" : [ {
"name" : "test_xfail_marked_test",
"uid" : "9fa539ea2c75034a",
"parentUid" : "666d1a31450af3ae8459f14f07f9a1b4",
"status" : "failed",
"time" : {
"start" : 1600590716858,
"stop" : 1600590716859,
"duration" : 1
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ ]
} ],
"uid" : "666d1a31450af3ae8459f14f07f9a1b4"
} ],
"uid" : "8fb3a91ba5aaf9de24cc8a92edc82b5d"
} ]
}
app.js:39 jQuery.Deferred exception: Cannot read property 'toLowerCase' of undefined TypeError: Cannot read property 'toLowerCase' of undefined
at byName (http://10.22.33.232:54855/app.js:60:132807)
at comparator_compare (http://10.22.33.232:54855/app.js:60:133454)
at http://10.22.33.232:54855/app.js:60:133700
at Array.sort ()
at TreeCollection.value (http://10.22.33.232:54855/app.js:60:119030)
at http://10.22.33.232:54855/app.js:60:118875
at Array.map ()
at TreeCollection.value (http://10.22.33.232:54855/app.js:60:118836)
at TreeCollection.value (http://10.22.33.232:54855/app.js:60:118626)
at TreeView.value (http://10.22.33.232:54855/app.js:60:135747) undefined
```
**Expected behavior**
User can see test categories on Categories tab page
**Environment (please complete the following information):**
python 3.8.2
pytest==6.0.2
allure-pytest==2.8.18
allure-cli: 2.13.5
**Python code to reproduce**
```python
import pytest
def test_passed_test():
assert 1 == 1
def test_failed_test():
assert 2 == 1
@pytest.mark.xfail(reason='Some reason', strict=True)
def test_xfailed_test():
assert 3 == 4
# problem is here ...
@pytest.mark.xfail(reason='Some reason', strict=True)
def test_xfail_marked_test():
assert 5 == 5
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện báo cáo bằng đoạn mã Python và kiểm tra data/categories.json được tạo cùng với tab Categories và stack trace app.js được hiển thị trong issue. Hoàn tất khi báo cáo mở tab Categories và hiển thị cả các category thông thường lẫn các category liên quan đến strict xfail mà không có lỗi 404 hoặc lỗi JavaScript.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, python
- Lĩnh vực
- testing
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100