Allure installation configuration and automated test report

1. Install allure

Download: http: //allure.qatools remove ru /.

Download the latest version

 

 

 

Need java8 +, JDK 1.8+ environment, it is already configured java environment. allure.bat under running after installation bin directory

Add the installation path \ allure-2.13.1 \ bin to your PATH environment variable

 

 

After the successful installation configuration, use the following command to ensure that Allure is available.

2.Allure integrated automation testing process

Allure integrated into the steps of:

  • 1. write automated test engineering to achieve "unit testing / API test / UI Test"

  • 2. Download the configuration Allure Service

  • 3. Allure support the introduction of automated testing project

  • 4. The introduction of Allure notes in automated test engineering

  • 5. Specify the configuration file, choose to run the test suite

  • 6. Run Allure service report shows

3, download the plug-in pycharm the allure: pip install allure-pytest

Join --alluredir = filename / main.py in the file, then run

复制代码
import pytest

if __name__ == '__main__':
    pytest.main(['-m register', '-s',
                 '--resultlog=reports/demo.txt',
                 '--junitxml=reports/demo.xml',
                 '--html=reports/demo.html',
                 '--alluredir=alluredir/'])
复制代码

You can see the file into a directory newborn alluredir file

 查看报告,需要启动allure服务,在terminal中输入:allure serve 生成文件名,即allure serve alluredir

 

 可以看到allure在本地开启了一个端口,这个就是报告地址,打开该地址即可

4、在jenkins中下载allure插件

5.执行脚本

case test_demo1.py
 

 

 

运行case
运行完成后会在指定目录下生产xml报告
 
使用allure生产html可视化报告

 

 

Guess you like

Origin www.cnblogs.com/dydxw/p/12170606.html