linux上下载allure
时间: 2023-12-03 13:02:10 浏览: 28
您可以在Linux上使用以下命令来下载Allure:
1. 首先,安装Wget和Unzip命令:
sudo apt-get update
sudo apt-get install wget unzip
2. 然后,使用以下命令下载Allure:
wget https://github.com/allure-framework/allure2/releases/download/2.13.5/allure-2.13.5.zip
3. 下载完成后,使用以下命令解压缩Allure:
unzip allure-2.13.5.zip
4. 最后,将Allure添加到PATH环境变量中:
export PATH=$PATH:/path/to/allure-2.13.5/bin
请注意,您需要将“/path/to/allure-2.13.5”替换为Allure所在的实际路径。
相关问题
linux如何使用allure
Allure是一个用于生成测试报告的开源框架,支持多种编程语言和测试框架。在Linux系统中,可以通过以下步骤来使用Allure:
1. 安装Java运行环境:Allure需要Java 8或以上版本的运行环境。在Linux中可以使用apt-get或yum等命令安装,例如:
```
sudo apt-get update
sudo apt-get install default-jre
```
2. 安装Allure命令行工具:可以从Allure官网下载最新版本的Allure命令行工具,并解压到一个目录中,例如:
```
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.13.6/allure-commandline-2.13.6.zip
unzip allure-commandline-2.13.6.zip -d /opt/
```
3. 在测试框架中集成Allure:Allure支持多种测试框架,例如JUnit、TestNG、Cucumber等。在测试框架中添加Allure的依赖和插件,例如在Maven项目中添加以下依赖:
```
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-junit4</artifactId>
<version>2.13.6</version>
<scope>test</scope>
</dependency>
```
4. 运行测试并生成报告:在执行测试时,需要使用Allure的命令行工具来生成测试报告。例如,使用JUnit执行测试,并生成Allure格式的报告:
```
java -jar /opt/allure-commandline-2.13.6/bin/allure.jar generate /path/to/allure-results -o /path/to/allure-report
```
其中,/path/to/allure-results是测试结果输出目录,/path/to/allure-report是报告输出目录。执行完命令后,在报告输出目录中可以看到生成的测试报告。
注意:在使用Allure前,需要了解测试框架和测试报告的相关知识。同时,Allure也提供了详细的文档和示例供参考。
linux allure
Linux下使用Allure生成测试报告的步骤如下:
1. 执行命令`allure generate allure_reports -o allure_reports/html --clean`来生成测试报告。其中,`allure_reports`是存放json文件的目录,`allure_reports/html`是存放html报告的目录,可以直接打开html文件来预览报告。
2. 执行命令`allure serve allure_reports`来启动Allure服务,展示测试报告。其中,`allure_reports`是存放json文件的目录。
以下是一个完整的使用Allure生成测试报告的Python代码示例:
```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Auth : xxx
# @Time : 2020/09/29 17:24
import pytest
import allure
@allure.feature("登录功能")
class Test_alls():
@allure.story("正常登录")
@allure.severity("blocker")
@allure.tag("最重要","回归测试")
@allure.description("用例描述:使用正确的手机号和密码登录")
@allure.title("登录功能:正常登录")
@allure.step(title="allure通过注解方式完成内容的展示,setp表示测试步骤1...")
def test_setup(self):
""" 用例描述:使用正确的手机号和密码登录 """
print("我就是打酱油的setup")
@allure.step(title="run就是一个正常的方法.")
def test_run(self):
allure.attach("自定义描述1", "描述内容,自定义")
print("我要运行")
assert True
def test_skip(self):
print("我要跳过")
@allure.severity(allure.severity_level.BLOCKER) # 严重级别
@allure.testcase("http://www.baidu.com/", "测试用例的地址")
@allure.issue("http://music.migu.cn/v3/music/player/audio", "点击可跳转到bug地址")
def test_error(self):
with allure.attach("自定义描述1", "我需要让他进行错误"):
print("我错误了")
assert False
```
通过上述步骤和示例代码,你可以在Linux下使用Allure生成测试报告。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [linux下allure安装及生成测试报告](https://blog.csdn.net/bang152101/article/details/108874136)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)