npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yapi-plugin-pl-auto-test

v1.4.44

Published

YAPI自动化测试插件,支持在YAPI设置测试计划,历史测试结果存入ES,界面显示测试结果,自定义通知。

Downloads

117

Readme

yapi-plugin-pl-auto-test

在分组的项目导航栏中加入自动化测试标签,支持直接在项目中设置服务端测试计划。并支持增加将集合测试结果存入es

说明

本插件扩展自yapi-plugin-auto-test,在原有作者代码上,增加了对每次计划时,测试结果的ES推送,其余原有功能保持不变

安装

第一步:在config.json这层目录下运行 yapi plugin --name yapi-plugin-pl-auto-test安装插件

第二步:如果配置代理转发可能导致无法正确获取到host的情况下,请修改config.json的配置。默认可以忽略

{
    "name": "pl-auto-test",
    "options": {
      "host": "http://localhost:3000",
      "esHost":"localhost:9200",
      "esUsername":"xxxx",
      "esPwd":"xxxxx",
      "indexName":"xxxx",
      "dataSource":"xxxx"
    }
}

第三步: 重启服务器

这里面的配置项含义如下:

  • esHost es集群的host地址,当该key不存在时,即不使用es存储结果,只保留原yapi-plugin-auto-test自带的mongo存储
  • esUsername es集群访问用户名,当该key不存在时,即elasticsearch没有开启登录认证
  • esPwd es集群用户密码
  • indexName 数据插入到Es的哪个索引里
  • dataSource 标明数据来源,会作为Es中一条document中source字段的值

使用

测试计划

用户可以自定义多个测试计划,根据对应的设置项进行测试计划的设置。

自定义通知目前只支持企业微信通知,如果url为空则不发送通知,邮件通知不受触发通知影响。

测试结果

时间轴风格的测试结果列表,支持直接查看历史测试结果。注意:测试结果页面的清空会直接清空当前计划的历史测试结果,谨慎操作。

更新

通过yapi-cli更新插件还是比较麻烦的,直接再执行一次命令并不会更新。因为yapi-cli安装插件实际上就是在vendors目录下执行npm install --registry https://registry.npm.taobao.org yapi-plugin-auto-test,所以最后会在package.json文件中记录下开始安装的版本号,再次执行安装的还是同一个版本。

执行如下操作可以进行更新:

  1. 需要先清除ykit的缓存,删除./vendors/node_modules/.ykit_cache文件夹
  2. 修改package.json里面yapi-plugin-pl-auto-test的版本或者直接npm i yapi-plugin-pl-auto-test@version
  3. ./vendors/目录中执行命令NODE_ENV=production ykit pack -m
  4. 在config.json这层目录下执行命令yapi plugin --name yapi-plugin-pl-auto-test后再重启服务器就完成安装指定版本的插件

ChangeLog

v1.0.0

  • 在yapi-plugin-auto-test基础上,增加es storage