allure

PyCharm中import allure提示No module named allure

笑着哭i 提交于 2020-02-28 15:24:35
问题: PyCharm中导入allure,import allure红色下划线提示No module named allure,没有叫做allure的模块 解决: 1.在PyCharm中选择File->Settings 2.选择项目目录(如Project:PythonWorkSpace)->Project Interpreter->点击右侧加号“+” 3.输入allure-pytest,选中后点击Install Package 4.等待提示安装成功后即可解决该问题 来源: CSDN 作者: mingliuTester 链接: https://blog.csdn.net/qq_29891879/article/details/104551430

pytest生成allure报告

假如想象 提交于 2020-02-26 11:59:29
使用pip安装pytest和allure-pytest   pip install pytest   pip install allure-pytest allure工具配置 allure是一个命令行工具,需要去github上下载最新版: https://github.com/allure-framework/allure2/releases 下载完成之后,解压到本地 把bin目录添加到环境变量Path下 执行用例 cd到test_***.py所在的目录文件,命令行执行 pytest --alluredir ./outputs/reports/allure_json 执行完成后,在工程目录下,report目录会生成一个allure_json目录包含测试报告的原始文件 打开html的报告需要启动allure服务 allure serve outputs/reports/allure_json 启动服务后,直接用默认浏览器打开报告 来源: https://www.cnblogs.com/lizhe860/p/12365795.html

自动化测试脚本的编写

走远了吗. 提交于 2020-02-13 21:23:17
需求: 从Excel中读取记录行(每一行就是一个API(url,请求类型,名称,描述,参数,预期值)) 使用参数化对每一次的请求,要使用requests发请求,获取请求结果,从结果中提取字段,跟预期值做断言, 使用allure生成测试报告 为每一个请求用例添加title和description 将测试报告发邮件 问题:发邮件的时候,能发文件夹吗?答案是不能, 解决办法是:将allure报告文件夹打包成zip 发送zip文件 在你认为的关键点添加上log日志 请求的时候 断言的时候 可选打包的时候 读Excel的时候 为了解耦合,需要遵循软件开发规范 数据文件夹 配置文件夹 脚本文件夹 等等 如果写的困难得,可以在一个文件中实现 用到的知识点: requests pytest Excel表格操作 发邮件 日志功能 项目开发规范的目录应用 allure title知识点       2.description知识点 一、1.把软件开发规范的相关目录建立起来: 二、配置settings: import osimport datetimeimport shutilimport sysbase_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))# print(base_dir) #D:\s27\day69\nb#

allure的其他参数

烈酒焚心 提交于 2020-01-21 23:28:03
import pytestimport requestsimport allure l = [ { "url": "https://www.v2ex.com/api/site/info.json", "title":"v2ex的title", "desc":"v2ex的描述信息", "expect": {"title": "V2EX","slogan1111":"way to explore","domain":"www.v2ex.com"} }, { "url": "https://cnodejs.org/api/vl/topics", "title":"cnodejs的title", "desc":"cnodejs的描述", "expect": {"success": True}},]@pytest.mark.parametrize("d", l)def test_case(d): #allure的动态参数 dynamic allure.dynamic.title(d["title"]) allure.dynamic.description(d["desc"]) response = requests.get(url=d["url"]).json() for k in d["expect"]: print(333333,k) if d["expect"][k] !=

接口自动化框架(Pytest+request+Allure)

自古美人都是妖i 提交于 2020-01-10 10:56:03
前言: 接口自动化是指模拟程序接口层面的自动化,由于接口不易变更,维护成本更小,所以深受各大公司的喜爱。 接口自动化包含2个部分,功能性的接口自动化测试和并发接口自动化测试。 本次文章着重介绍第一种,功能性的接口自动化框架。 一、简单介绍 环境:Mac、Python 3,Pytest,Allure,Request 流程:读取Yaml测试数据-生成测试用例-执行测试用例-生成Allure报告 模块类的设计说明: Request.py 封装request方法,可以支持多协议扩展(get\post\put) Config.py 读取配置文件,包括:不同环境的配置,email相关配置 Log.py 封装记录log方法,分为:debug、info、warning、error、critical Email.py 封装smtplib方法,运行结果发送邮件通知 Assert.py 封装assert方法 run.py 核心代码。定义并执行用例集,生成报告 Yaml测试数据格式如下: --- Basic: dec: "基础设置" parameters: - url: /settings/basic.json data: slug=da1677475c27 header: { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6)

jenkins学习8-生成Allure报告(Allure Jenkins Plugin)

女生的网名这么多〃 提交于 2020-01-09 23:16:57
前言 jenkins上集成allure的报告才是高大上的,jenkins集成了allure插件,安装插件后运行pytest+allure的脚本即可在jenkins上查看allure报告了。 allure安装 在运行代码的服务器本机,我这里是用的docker容器,在容器内部安装allure-pytest。 先进docker容器 docker exec -it -u root 容器id /bin/bash 安装allure-pytest包 pip3 install allure-pytest==2.8.6 --index-url https://pypi.douban.com/simple 详细安装教程参考这篇 https://www.cnblogs.com/yoyoketang/p/12004145.html Allure Jenkins Plugin插件安装 docker容器内部准备好 Allure 的环境后,接着在jenkins上安装 Allure Jenkins Plugin 插件 打开jenkins首页-系统管理-管理插件-可选插件,搜索:Allure 安装完成后打开jenkins首页-全局工具配置-Allure Commandline, 安装 allure 命令行工具 勾选自动安装,版本选择最新版2.13就可以了 执行shell 运行的pytest脚本上传到github

Allure Framework: TestNG adapter incorrectly places @AfterMethod in report

人盡茶涼 提交于 2020-01-02 05:41:13
问题 I`m using allure V1.4.8 +TestNG. It looks like TestNG adapter incorrectly places @AfterMethod in report - basically it places AfterMethod from test case into next testcase. Here is the simple code: @Step("a test1") @Test public void Test1(){ } @Step("a test2") @Test public void Test2(){ } @Step("before method") @BeforeMethod public void beforeMethod(){ } @Step("after method") @AfterMethod public void methodCleanup() { } And here is the generated report: <test-cases> <test-case start=

Configuration in Allure to Cucumber in Ruby

核能气质少年 提交于 2019-12-30 10:55:07
问题 I need to configure the following params: environment, trend, history, executors, retries, etc. I need these params for cucumber to work with ruby. I searched in a lot of places and I did not find much. I would appreciate if you can provide these params. 回答1: History Allure stores history information to allure-report/history folder during report generation. So you need to copy such folder from previous launch into your allure-results before you generate the report. History features are

Can allure be used with a s3 bucket full of test result XML files

天大地大妈咪最大 提交于 2019-12-24 20:16:36
问题 I have just discovered Allure thanks to this post: How to display a directory full of junit test result files I am wondering if Allure is in fact suited for this situation. Basically, I am looking to visualize test results that are collected in an s3 bucket. These results were pushed out of kubernetes jobs that run the tests with gradle. Allure could be added to the build.gradle (and it would be great to be able to use the allure annotations). Ideally, I would like to get as much of the

createAttachment using mocha-allure-reporter

∥☆過路亽.° 提交于 2019-12-24 20:14:54
问题 Im trying to add a screenshot as an attachment in allure reports using mocha-allure-reporter. I dont get any errors, but the screenshot does not have save in ./reports/allure-results, and no console log either. Is this the correct way to use allure.createAttachment? declare const allure: any; afterEach('first step', function () { allure.createStep('initial', () => { browser.takeScreenshot().then(function (png) { allure.createAttachment('Screenshot', function () { return new Buffer(png,