newman的常用命令使用總結


前提:為了運行newman,你要確保系統中安裝的Node.js版本是大於v6的。

命令常用選項:

 newman [optiions]
  • -h:顯示命令行幫助,包括選項列表和簡單的使用案例。

  • -v:顯示當前newman的版本。

newman run json文件  [options]
  • -e source:用來指定環境變量文件的路徑。

  • -g source:用來指定全局變量文件的路徑。

  • -r reporter-name:用來指定產生的數據結果的模型,如json,html等。
  • --reporter-html-export:指定html報告寫出的路徑。
newman run test.json -e testing.postman_environment.json --reporter-html-export c:\newmanoutput\test_result.json

注:在使用--reporter-html-export進行導出測試結果前,首先需要使用npm install -g newman-reporter-html安裝reporter-html-export,否則測試結果無法自動生成到指定的目錄中。

 

 

 

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM