当前位置:网站首页>2022 software testing skills postman+newman+jenkins continuous integration practical tutorial
2022 software testing skills postman+newman+jenkins continuous integration practical tutorial
2022-07-26 16:43:00 【xmfboss】
List of articles
Tips : Before reading this chapter , Please read the catalogue first
List of articles
Preface
newman yes Postman To launch the nodejs The library of , Simply speaking , It can be run from the command line postman Test set for
One 、Nodejs
Install first nodejs, And configure environment variables
Two 、npm install newman
cmd Command line , Input :npm install newman
To install newman
And then through ,newman -v To verify , Is the installation successful
C:\Users\THINK>newman -v
5.3.2
3、 ... and 、Postman Export test set
Select test set , And then choose Export


then , You can save to a new folder
such as ,D:\newman
Four 、newman run function
cmd, Go to this folder
Enter the name :newman run baidu.postman_collection.json

We can see the results of the run

5、 ... and 、 Generate test reports
Enter the command :
newman run baidu.postman_collection.json -r html --reporter-html-expor
t index.html
-r Is export mode , We choose to export as html
–reporter-html-export , export path


After running , The test report is automatically generated

6、 ... and 、run Additional data files 、 environment variable
If our test set , With environment variables , What about data files ?
It's simple , If it is an environment variable , Just lead out , And put it together
If there are data files , Also put together
First step , We define environment variables Environment

And then click Edit

then Export

environment variable , I'm requesting parameters params It is used in

The second step , We used data files




Can successfully read , explain , There is no problem with the data file format
then , We went to the Tests Assert to use this data

The third step , Remember again Export This test set
Step four , thus , We have these documents

then , We can run the command
newman run Test set file -e Environment variables file -d Data files -r html --reporter-html-export index.html
If it's a global variable , You can add -g Global variable file
And then run
D:\newman>newman run baidu.postman_collection.json -e baidu.postman_environment.
json -d testdata.csv -r html --reporter-html-export index.html
You can see the test report regenerated

Here is a test that failed

Explain that there is our test data in the assertion
If we don't reference data files , What will happen? ?
The result is , The obtained variable is undefined
expected 1 to deeply equal undefined
7、 ... and 、htmlextra
htmlextra, It is a better test report plug-in
First step , Let's install
npm install newman-reporter-htmlextra
The second step , Carry out orders , Replace with
D:\newman>newman run baidu.postman_collection.json -r htmlextra --reporter-html-
export index.html
The third step , View test report



8、 ... and 、Jenkins+newman






After running , View test report


Update log
Tips : Will continue to optimize and update
20220725,Nodejs,npm instal newman,Postman Export test set ,newman run function , Generate test reports ,run Additional data files , environment variable ,htmlextra,Jenkins+newman
边栏推荐
- C # method to read the text content of all files in the local folder
- Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)
- Linux安装mysql8.0.29详细教程
- The process and harvest of developing browser plug-ins with clojurescript
- A firefox/chrome plug-in that visualizes browser history
- 2022-2023 信息管理毕业设计选题题目推荐
- Class initialization mechanism of JVM
- Pat grade a 1048 find coins
- ES:Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes
- Selection of industrial serial port to WiFi port to Ethernet module of Internet of things
猜你喜欢

TDengine 落地协鑫能科,数百亿数据压缩至 600GB

Win11怎么自动清理回收站?

Tdengine landed in GCL energy technology, with tens of billions of data compressed to 600gb

FTP protocol

Comprehensive design of an oppe homepage -- Design of navigation bar

Tao and art of R & D Efficiency - Tao chapter

A preliminary understanding of MVC and ECS design architectures

2022-2023 topic recommendation of information management graduation project

操作系统迁移实战之在openEuler上部署MySQL数据库

Differences between the use of structs and classes
随机推荐
ACL-IJCAI-SIGIR顶级会议论文报告会(AIS 2022)笔记3:对话和生成
Nacos win10 安装配置教程
Response object - response character data
C # method to read the text content of all files in the local folder
PyQt5快速开发与实战 3.4 信号与槽关联
导数、微分、偏导数、全微分、方向导数、梯度的定义与关系
Pat class a 1047 student list for course
Replicationcontroller and replicaset of kubernetes
Vlang's way of beating drums
srec_cat 常用参数的使用
The difference between anonymous methods and lambda expressions
Understanding JS foundation and browser engine
Oracle创建表分区后,查询的时候不给出partition,但是会给分区字段指定的值,会不会自动按照分区查询?
movable-view 组件(可上下左右拖动 )
Analyzing method and proc in Ruby
2022-2023 信息管理毕业设计选题题目推荐
The difference and efficiency comparison of three methods of C # conversion integer
我的sql没问题为什么还是这么慢|MySQL加锁规则
量化交易之数字货币篇 - 通过时间戳与方向来合并逐笔成交数据(大单合并)
综合设计一个OPPE主页--顶部,头部的设计