如何使用 Allure-behave 自定义 Allure 报告

问题描述 投票:0回答:1

我正在使用 allure-behave 用作行为 selenium 项目的测试结果的 GUI。报告的生成广告视图很好,但魅力服务器中总是有很多空白区域。

例如,概述、类别或环境部分的“趋势”部分没有任何内容。这总是让它看起来不完整......

我知道在 pytest-allure 中你可以使用类似的东西:

@allure.title("Test Authentication") @allure.tag("NewUI", "Essentials", "Authentication") @allure.severity(allure.severity_level.CRITICAL) @allure.label("owner", "John Doe")

但是,在行为上它无法解析它们。

ParserError: Failed to parse "Calculator.feature": tag: Authentication") (line: @allure.title("Test Authentication")) at line 4

所以我的问题是如何添加元数据来进行行为测试以填写 allure 服务器中的所有部分?

allure python-behave
1个回答
0
投票

也许这会有所帮助 https://github.com/allure-framework/allure-python/tree/master/allure-behave/examples 请注意,您使用的符号是为了 pytest 吸引力,而不是行为,因此存在差异。不需要用@allure标记所有内容,你应该标记 像这样的东西:

@critical @Authentication @allure.label.author:John_Doe
@allure.label.epic="something"
@alllure.label.story="something_else" 

这应该有效

© www.soinside.com 2019 - 2024. All rights reserved.