Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事

使用anywhere 运行的时候报错 当然使用 npm cnpm 的时候 只要报 禁止运行 就可以用此办法解决

文章目录

一、allure的下载

https://github.com/allure-framework/allure2/releases
下载最新版本

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事

; 二、allure的安装

1.解压完成后,进入文件夹bin中

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事

node.js下载级目录

三、allure的环境配置

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
编辑,加入allure路径
但是这是本地;
我们可以借助 Anywhere 来实现局域网内分享报告

; 四、借助anywhere来实现局域网内分享报告

1.先配置Nodejs环境,官网下载地址:Node.js 官网下载地址

2.运行安装程序

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
3.cmd 窗口运行 :node –version ,回车查看是否显示版本号
Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
4.输入 npm 命令进行 anywhere 的安装
npm install -g anywhere

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
5、在allure运行的目录,鼠标右击打开终端
Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
五.powershell开启管理员身份运行

1.打开powershell,点击设置

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事

6.在终端执行:get-ExecutionPolicy,显示Restricted(表示状态是禁止的)
7、在终端执行:set-ExecutionPolicy RemoteSigned
8、在终端执行:get-ExecutionPolicy,显示变为RemoteSigned(表示状态是执行的)
9.再次输入anywhere,配置成功

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
; 六、allure切换监听端口号/报告设置中文

1.如果想切换监听端口号,也可以自定义,防止占用

anywhere -p 5678

2.打开allure的安装目录,我这里是allure-2.19.0\plugins\custom-logo-plugin\static,第一次进去是没图片的

Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
然后找到下图位置,将需要的图片放在这个文件夹里面,可以命名为:allure——logo.jpg
3.打开styles.css,修改
Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事
.side-nav__brand {
  background: url('allure_logo.jpg') no-repeat left center !important;
  margin-left: 10px;
  height: 50px;
  background-size: contain !important;
}

.side-nav__brand span{
  display: none;
}
.side-nav__brand:after{
  content: "helen";
  margin-left: 20px;
}

Original: https://blog.csdn.net/ndhelen/article/details/126706222
Author: 咖喱饭YYDS
Title: Pytest+Allure的安装:报告本地运行,分享给局域网内其他同事

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/773662/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球