亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Postman測(cè)試報(bào)告的生成方法

 更新時(shí)間:2022年01月14日 09:18:55   作者:特昂糖  
做完測(cè)試后,都會(huì)編寫一份測(cè)試報(bào)告,測(cè)試報(bào)告中最主要的就是呈現(xiàn)出測(cè)試結(jié)果,哪些用例通過(guò)了,哪些用例沒(méi)有通過(guò)。像postman這么強(qiáng)大的功能也可以自動(dòng)生成報(bào)告,供我們測(cè)試同學(xué)進(jìn)行查看,顯得更加有B格

我們使用工具newman就可以生成測(cè)試報(bào)告(自動(dòng)化測(cè)試的結(jié)果)

Newman是一款基于nodejs開發(fā)的可以運(yùn)行postman腳本的工具,使用Newman,可以直接從命令運(yùn)行和測(cè)試postman集合。

使用newman的前提是需要安裝node.js,通過(guò)node.js來(lái)安裝newman的工具

安裝newman的命令:

npm install -g newman --registry=https://registry.npm.taobao.org

1.安裝node.js

  下載地址:https://nodejs.org/en/download/下載適合自己電腦的版本,這里我們使用Windows平臺(tái)

  安裝:只需雙擊即可完成安裝,在這里建議不要將路徑放到C盤,這是一種安裝軟件的共識(shí)。并且在安裝的過(guò)程中,安裝向?qū)б呀?jīng)幫我們完成了環(huán)境變量的注冊(cè),我們可以通過(guò)環(huán)境變量來(lái)查看

  驗(yàn)證是否配置成功:控制臺(tái)輸入npm,如果顯示以下數(shù)據(jù)則表示安裝并且配置成功

C:\Users\特昂糖>npm
npm <command>
Usage:
npm install        install all the dependencies in your project
npm install <foo>  add the <foo> dependency to your project
npm test           run this project's tests
npm run <foo>      run the script named <foo>
npm <command> -h   quick help on <command>
npm -l             display usage info for all commands
npm help <term>    search for help on <term> (in a browser)
npm help npm       more involved overview (in a browser)
All commands:
    access, adduser, audit, bin, bugs, cache, ci, completion,
    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    edit, exec, explain, explore, find-dupes, fund, get, help,
    hook, init, install, install-ci-test, install-test, link,
    ll, login, logout, ls, org, outdated, owner, pack, ping,
    pkg, prefix, profile, prune, publish, rebuild, repo,
    restart, root, run-script, search, set, set-script,
    shrinkwrap, star, stars, start, stop, team, test, token,
    uninstall, unpublish, unstar, update, version, view, whoami
Specify configs in the ini-formatted file:
    C:\Users\特昂糖\.npmrc
or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@8.1.2 D:\Ruanjian\node_modules\npm   #這里顯示的是軟件所在本地磁盤路徑

2.安裝newman

  node.js配置成功后我們就可以安裝newman了,安裝newman的命令為:npm install -g newman --registry=https://registry.npm.taobao.org

C:\Users\特昂糖>npm install -g newman --registry=https://registry.npm.taobao.org
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 128 packages in 13s
npm notice
npm notice New minor version of npm available! 8.1.2 -> 8.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.0
npm notice Run npm install -g npm@8.3.0 to update!
npm notice

  驗(yàn)證是否安裝成功:

C:\特昂糖>newman
Usage: newman [options] [command]
Options:
  -v, --version               output the version number
  -h, --help                  display help for command
Commands:
  run [options] <collection>  Initiate a Postman Collection run from a given URL or path
To get available options for a command:
  newman <command> -h

3.控制臺(tái)生成測(cè)試報(bào)告

首先在postman中導(dǎo)出測(cè)試數(shù)據(jù)

這里以我的為例,下載地址:http://xiazai.jb51.net/202201/yuanma/postman_collection_jb51.rar

控制臺(tái)進(jìn)入導(dǎo)出文件所在本地磁盤路徑
生成測(cè)試報(bào)告

newman run ?+導(dǎo)出的測(cè)試數(shù)據(jù)文件名稱

4.生成HTML的測(cè)試報(bào)告    

安裝HTML套件

newman 支持四種格式報(bào)告文件:cli,json,html,junit
生成 html 報(bào)告時(shí)需要安裝html套件,命令行中執(zhí)行:
  npm install -g newman-reporter-html
? ? ?輸出報(bào)告時(shí)使用的命令:
    -r html,json,junit ? ? ? ? 指定生成html,json,xml形式的測(cè)試報(bào)告
    --reporter-json-export jsonReport.json ? ? ? ? ?生成json格式的測(cè)試報(bào)告
    --reporter-junit-export xmlReport.xml ? ? ? ? ? ?生成xml格式的測(cè)試報(bào)告
    --reporter-html-export htmlReport.html ? ? ? ? ?生成html格式的測(cè)試報(bào)告
    默認(rèn)生成的測(cè)試報(bào)告保存在當(dāng)前目錄下,如果文件名前加上路徑,則保存在指定的目錄下

  例:輸出json和html文件報(bào)告

生成html測(cè)試報(bào)告

輸出命令:
       newman run 風(fēng)暴平臺(tái).postman_collection.json -r html

5.輸出htmlextra報(bào)告

安裝htmlextra套件

npm install -g newman-reporter-htmlextra

運(yùn)行htmlextra套件 

newman run 風(fēng)暴平臺(tái).postman_collection.json -r htmlextra

結(jié)果展示

到此這篇關(guān)于Postman測(cè)試報(bào)告的生成的文章就介紹到這了,更多相關(guān)Postman測(cè)試報(bào)告內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Postman全局注冊(cè)方法及對(duì)返回?cái)?shù)據(jù)可視化處理

    Postman全局注冊(cè)方法及對(duì)返回?cái)?shù)據(jù)可視化處理

    這篇文章主要為大家介紹了Postman全局注冊(cè)方法及對(duì)返回?cái)?shù)據(jù)可視化處理詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-02-02
  • 詳解IDEA Git Reset 選項(xiàng)說(shuō)明

    詳解IDEA Git Reset 選項(xiàng)說(shuō)明

    這篇文章主要介紹了詳解IDEA Git Reset 選項(xiàng)說(shuō)明,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • 日歷控件和天氣使用分享

    日歷控件和天氣使用分享

    本文給大家分享的2個(gè)簡(jiǎn)單而且實(shí)用的小功能代碼,分別是日歷控件和天氣預(yù)報(bào)接口,推薦給大家,需要的小伙伴快來(lái)參考下吧
    2015-03-03
  • Chrome 調(diào)試技巧(小結(jié))

    Chrome 調(diào)試技巧(小結(jié))

    這篇文章主要介紹了Chrome 調(diào)試技巧(小結(jié)),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09
  • 日常收集整理的Git常用命令

    日常收集整理的Git常用命令

    Git 是一個(gè)很強(qiáng)大的分布式版本控制系統(tǒng)。它不但適用于管理大型開源軟件的源代碼,管理私人的文檔和源代碼也有很多優(yōu)勢(shì)。下面腳本之家小編給大家?guī)?lái)了Git 常用命令,感興趣的朋友一起看看吧
    2017-10-10
  • vscode中setting.json配置文件配置詳解

    vscode中setting.json配置文件配置詳解

    這篇文章主要給大家介紹了關(guān)于vscode中setting.json配置文件配置的相關(guān)資料,VSCode中的setting.json文件用于存儲(chǔ)用戶自定義的配置設(shè)置,文中給出了詳細(xì)的代碼示例,需要的朋友可以參考下
    2023-09-09
  • 快速解決eclipse中注釋的代碼依然會(huì)執(zhí)行的問(wèn)題

    快速解決eclipse中注釋的代碼依然會(huì)執(zhí)行的問(wèn)題

    下面小編就為大家?guī)?lái)一篇快速解決eclipse中注釋的代碼依然會(huì)執(zhí)行的問(wèn)題。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2016-12-12
  • 詳解git merge命令應(yīng)用的三種情景

    詳解git merge命令應(yīng)用的三種情景

    這篇文章主要介紹了詳解git merge命令應(yīng)用的三種情景,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • Web 開發(fā)常用工具 大家自己查找下載

    Web 開發(fā)常用工具 大家自己查找下載

    看到了Web通信分析工具 這篇文章,除了burpsuite其他我日常都經(jīng)常使用。于似乎我整理了一下我自己用的其他的WEB開發(fā)工具。
    2009-06-06
  • 詳解VSCode打開多個(gè)項(xiàng)目文件夾的解決方法

    詳解VSCode打開多個(gè)項(xiàng)目文件夾的解決方法

    這篇文章主要介紹了詳解VSCode打開多個(gè)項(xiàng)目文件夾的解決方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-04-04

最新評(píng)論