最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Postman測試報告的生成方法

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

我們使用工具newman就可以生成測試報告(自動化測試的結(jié)果)

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

使用newman的前提是需要安裝node.js,通過node.js來安裝newman的工具

安裝newman的命令:

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

1.安裝node.js

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

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

  驗證是否配置成功:控制臺輸入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

  驗證是否安裝成功:

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.控制臺生成測試報告

首先在postman中導出測試數(shù)據(jù)

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

控制臺進入導出文件所在本地磁盤路徑
生成測試報告

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

4.生成HTML的測試報告    

安裝HTML套件

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

  例:輸出json和html文件報告

生成html測試報告

輸出命令:
       newman run 風暴平臺.postman_collection.json -r html

5.輸出htmlextra報告

安裝htmlextra套件

npm install -g newman-reporter-htmlextra

運行htmlextra套件 

newman run 風暴平臺.postman_collection.json -r htmlextra

結(jié)果展示

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

相關文章

  • Vscode一些常用操作圖文教程

    Vscode一些常用操作圖文教程

    這篇文章主要給大家介紹了關于Vscode的一些常用操作的相關資料,VSCode是一款非常流行的代碼編輯器,廣泛應用于前端開發(fā),文中給出了詳細圖文教程,需要的朋友可以參考下
    2023-08-08
  • 通過Cursor工具使用GPT-4的方法詳解

    通過Cursor工具使用GPT-4的方法詳解

    Cursor?是集成了?GPT-4?的?IDE?工具,目前免費并且無需?API?Key,支持?Win、Mac、Linux?平臺,可以按要求生成代碼,或者讓?AI?幫助優(yōu)化代碼,分析代碼,這篇文章主要介紹了通過Cursor工具使用GPT-4的方法,需要的朋友可以參考下
    2023-05-05
  • VScode內(nèi)接入deepseek包過程記錄

    VScode內(nèi)接入deepseek包過程記錄

    在VSCode中集成本地部署的DeepSeek-R1模型,通過擴展商店下載并配置Continue插件,實現(xiàn)模型的添加、連接和使用,過程中包括配置文件的修改、模型的刪除以及注意事項的處理,本文介紹VScode內(nèi)接入deepseek包過程,感興趣的朋友一起看看吧
    2025-02-02
  • git分支的創(chuàng)建、切換、合并及刪除操作小結(jié)

    git分支的創(chuàng)建、切換、合并及刪除操作小結(jié)

    這篇文章給大家詳細的介紹了關于git分支的操作,其中包括查看現(xiàn)存分支、創(chuàng)建分支、切換分支、提交分支、分支合并以及刪除分支,文中給出了詳細示例代碼,相信對大家的學習和理解很有幫助,有需要的朋友們下面來一起學習學習吧。
    2016-11-11
  • 使用MASA?Blazor開發(fā)查詢表格頁

    使用MASA?Blazor開發(fā)查詢表格頁

    MASA?Blazor?是一個基于?Material?Design?設計語言的?Blazor?組件庫,dotNET開發(fā)者只需或者甚至不需要懂得?javascript?就能開發(fā)一個企業(yè)級中后臺系統(tǒng),這篇文章主要介紹了使用MASA?Blazor開發(fā)一個標準的查詢表格頁,需要的朋友可以參考下
    2022-04-04
  • 詳解git的分支與合并的兩種方法

    詳解git的分支與合并的兩種方法

    這篇文章主要介紹了詳解git的分支與合并的兩種方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2020-07-07
  • git clone如何指定歷史版本

    git clone如何指定歷史版本

    這篇文章主要介紹了git clone如何指定歷史版本問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-05-05
  • 詳解vscode使用git所遇到的坑

    詳解vscode使用git所遇到的坑

    這篇文章主要介紹了詳解vscode使用git所遇到的坑,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2020-08-08
  • git中reset和revert區(qū)別小結(jié)

    git中reset和revert區(qū)別小結(jié)

    本文主要介紹了git中reset和revert區(qū)別小結(jié),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2023-06-06
  • 前端開發(fā)工具nvim替帶VSCode的安裝配置

    前端開發(fā)工具nvim替帶VSCode的安裝配置

    這篇文章主要為大家介紹了一款前端開發(fā)工具nvim代替VSCode的配置使用詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-07-07

最新評論

高唐县| 武鸣县| 巴彦淖尔市| 长阳| 射阳县| 且末县| 博客| 伽师县| 潜江市| 武义县| 襄城县| 类乌齐县| 于田县| 宝兴县| 称多县| 苏州市| 永仁县| 巫溪县| 嘉禾县| 嘉禾县| 水富县| 无为县| 临清市| 略阳县| 基隆市| 郑州市| 大埔区| 民乐县| 无锡市| 万源市| 司法| 商水县| 宁阳县| 伊吾县| 镇远县| 江安县| 大同县| 安福县| 凌海市| 仁化县| 宜阳县|