Allure 如何动态生成诱惑报告
我是新来诱惑报道的。我正在使用testng和Java8。每次运行测试时,我都需要执行“诱惑服务诱惑结果”。是否有一种方法可以自动更新结果,而不是每次启动命令?我在python中也遇到了同样的问题。所以,我想到的是通过pytest的conftest.py中的python脚本运行terminal命令Allure 如何动态生成诱惑报告,allure,Allure,我是新来诱惑报道的。我正在使用testng和Java8。每次运行测试时,我都需要执行“诱惑服务诱惑结果”。是否有一种方法可以自动更新结果,而不是每次启动命令?我在python中也遇到了同样的问题。所以,我想到的是通过pytest的conftest.py中的python脚本运行terminal命令 import subprocess def pytest_sessionfinish(session, exitstatus): """ Run comm
import subprocess
def pytest_sessionfinish(session, exitstatus):
"""
Run command to set allure path and generate allure report after the test run is over
"""
# Running pytest can result in six different exit codes:
# Exit code 0: All tests were collected and passed successfully
# Exit code 1: Tests were collected and run but some of the tests failed
# Exit code 2: Test execution was interrupted by the user
# Exit code 3: Internal error happened while executing tests
# Exit code 4: pytest command line usage error
# Exit code 5: No tests were collected
print '\nrun status code:', exitstatus
if (exitstatus != 2 or exitstatus != 3 or exitstatus!= 4 or exitstatus != 5):
command_to_export_allure_path= ['export PATH=$PATH:/usr/local/bin:/usr/local/bin/allure-commandline/allure-2.7.0/bin/']
command_generate_allure_report= ['allure generate --clean -o %s/Allure/ %s'%(allure_report_dir, allure_report_dir)]
print command_to_export_allure_path
print command_generate_allure_report
subprocess.call(command_to_export_allure_path, shell=True)
subprocess.call(command_generate_allure_report, shell=True)
我确信应该有某种方法可以通过java代码运行terminal命令步骤1:从Maven repository添加AllureReportBuilder的依赖项 步骤2:添加以下代码以生成诱惑报告 这将生成诱惑报告文件夹
new AllureReportBuilder("1.5.4", new File("target/allure-report")).unpackFace();
new AllureReportBuilder("1.5.4", new File("target/allure-report")).processResults(new File("target/allure-results"));
注意-以上代码属于allure1谢谢。这很有帮助