如何使用Python py.test实现Allure 2中的缺陷分类?

问题描述:

Allure 2 documentation中指出缺陷可以分类。 阿尔乔姆Eroshenko在他Allure 2 presentation还提到,为了这个目的categories.json配置文件应与正则表达式类创建:如何使用Python py.test实现Allure 2中的缺陷分类?

[ 
    { 
    "name": "Outdated selectors", 
    "messageRegex": ".*Unable to locate element.*", 
    "matchedStatuses": ["broken"] 
    }, 
    { 
    "name": "Browser cluster problems", 
    "messageRegex": ".*Timed out .* from renderer.*", 
    "matchedStatuses": ["broken"] 
    } 
] 

但也有关于实际执行此功能的文档没有详细说明。这个文件应该放在哪里?此功能是否在py.testallure 2适配器中实施?

您需要将categories.json文件放置到allure-results文件夹中。欲了解更多详情,请参阅其他答案https://*.com/a/46222758/3915166