allure-framework / allure-framework/allure-python

Categories tab 404 error when xfail marked test is passed (with pytest.mark.xfail(strict=True))

Ouverte
#816 2 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
814
Forks
260
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**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

```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Reproduisez le rapport avec l’extrait Python et inspectez le fichier data/categories.json généré ainsi que l’onglet Categories et la trace de la pile app.js affichée dans l’issue. C’est terminé lorsque le rapport ouvre l’onglet Categories et affiche les catégories ordinaires et celles liées à strict xfail sans 404 ni erreur JavaScript.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, python
Domaine
testing
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.