首页 > 其他分享 >Allure用法

Allure用法

时间:2023-08-26 11:12:39浏览次数:24  
标签:allure 用法 Allure io Test import qameta

查看官网:https://docs.qameta.io/allure/#_junit_5

源码example: https://github.com/allure-examples/allure-examples/tree/master/allure-junit5/src/test/java/io/qameta/allure/examples/junit5

 

 

添加描述信息

package com.allure;

import io.qameta.allure.Allure;
import io.qameta.allure.Description;
import org.junit.jupiter.api.Test;
public class AllureDescriptionTest {

    @Test
    @Description("静态描述信息")
    public void annotationDescriptionTest() {
    }

    @Test
    public void dynamicDescriptionTest() {
        assert 1+1 == 2;
        Allure.description("动态描述信息");

        assert 1+1 == 2;
        Allure.description("动态描述信息2");//会覆盖上面的描述信息

    }
}

 

添加链接信息

package com.allure;

import io.qameta.allure.Allure;
import io.qameta.allure.Link;
import org.junit.jupiter.api.Test;

public class AllureLinkTest {
    @Test
    @Link(name = "静态链接", url = "https://www.baidu.com")
    public void staticLinkTest() {
        assert 1 + 1 == 2;
    }
    @Test
    public void dynamicLinkTest() {
        assert 1 + 1 == 2;
        Allure.link("Dynamic link", "https://www.baidu.com");
    }
}

 

标签:allure,用法,Allure,io,Test,import,qameta
From: https://www.cnblogs.com/ixtao/p/17658506.html

相关文章

  • Allure常用命令
    命令格式:allure [option]  [command]  [commandoptions]allure--help帮助allure--version查看版本信息allureserve 生成在线版本的测试alluregenerate<allure-result中间文件> -o  输出目录(默认路径:allure-report)引入依赖<?xmlversion="1.0"e......
  • Allure环境安装
    1、安装Java(推荐1.8版本),需要配置环境变量2、安装Allure(2.13以上版本),需要配置环境变量【下载地址】https://repo1.maven.org/maven2/io/qameta/allure/allure-commandline/mac/linux:下载tarwindows:下载zip配置环境变量:解压后将bin目录加入PATH环境变量安......
  • Tarjan基础用法
    \(\operatorname{Tarjan}\)基础用法目录\(\operatorname{Tarjan}\)基础用法\(\operatorname{Tarjan}\)求最近公共祖先前置芝士实现过程例题\(\operatorname{Tarjan}\)求割点、割边前置芝士\(\operatorname{Tarjan}\)求割点\(\operatorname{Tarjan}\)求割边例题\(\operatorn......
  • git 用法 记录 处理分支 合并分支 解决分支冲突
      gitstatus  查看分支状态gitadd.提交到暂存区gitcommit-m'优化'提交到准备pushgitpull 拉取最新分支gitpush 提交到git上 gitbranch 查看所有分支gitcheckout 分支名字  切换到指定分支gitpullorigin'分支名字'  拉取分支名字最......
  • uiautomator2 截图+压缩图片+放入allure报告中
    defsave_screenshot(self,screenshot_path):"""截图保存到某个路径:paramscreenshot_path::return:"""self.d.screenshot(screenshot_path) screenshot_path=f&quo......
  • 直播平台搭建,JSON.parseObject的几种用法
    直播平台搭建,JSON.parseObject的几种用法一.result格式: {  "success":"true",  "returnAddress":"123"} JSONObjectjsonObject=JSON.parseObject(result); //转换成objectJsonObject.getString("returnAddress") //获取object中ret......
  • swift - 之TabBarController的用法
    TabBarController的使用,下面记录两种写法,代码如下:TabBarItem系统自带图标样式(System)介绍:Custom:自定义方式,配合SelectedImage来自定义图标More:三个点的图标,表示更多意思Favorites:星形图标Featured:星形图标TopTated:星形图标Recents:时钟图标Contacts:一个圆形一个人头像的图标,代表联......
  • curl的用法| curl是什么意思
    骑士李四记录;1.在服务器上查看请求是否返回正常:curl-ihttp://127.0.0.1:8080/api/abc返回这个表示请求返回ok。更多参考大神笔记:http://www.ruanyifeng.com/blog/2019/09/curl-reference.html......
  • Vue3内置组件suspense用法
    1、作用在使用异步组件时,由于需要等待组件加载完成后才能显示,因此可能会出现页面空白或显示错误信息的情况。而Suspense组件的作用就是在异步组件加载完成前显示一个占位符,提高用户体验。2、用法首先子组件AsyncShow:使用了promise包裹代码<template><div><h1>{{re......
  • C#log4net用法
    新建一个名为log4net.config的文件,然后把下面一段粘贴进去<?xmlversion="1.0"encoding="utf-8"?><configuration> <log4net> <!--OFF,FATAL,ERROR,WARN,INFO,DEBUG,ALL--> <!--SetrootloggerleveltoERRORanditsappend......