allure-framework / allure-framework/allure-python
Categories tab 404 error when xfail marked test is passed (with pytest.mark.xfail(strict=True))
- 主要言語
- Python
- スター
- 814
- フォーク
- 260
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**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
```
コントリビューションガイド
調査の方向性
Python スニペットでレポートを再現し、生成された data/categories.json を Categories タブおよび issue に示されている app.js のスタックトレースと併せて調査します。完了条件は、レポートが Categories タブを開き、404 や JavaScript エラーなしで通常のカテゴリと strict xfail 関連のカテゴリの両方を表示することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, python
- 領域
- testing
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100