顯示具有 Open Source 標籤的文章。 顯示所有文章
顯示具有 Open Source 標籤的文章。 顯示所有文章

2022年3月28日 星期一

[Newman] HTML reporter

 Testing   Newman   Postman  


 



Introduction


This article shows how to use Newman and HTML reporter(DannyDainton/newman-reporter-htmlextra) to generate the API test report by command.

 

Environment


Postman v9.15.6

Newman 5.3.2

 

 

 

Implement


 

Install Packages

 

$ npm install -g newman
$ npm install -g newman-reporter-htmlextra



Export collection and environment variables from POSTMAN as json files

 

(Optional) remember to export variables of target environment from Postman if you use variables on the Postman’s requests.

 

 

├─ Demo.postman_collection.json
└─ Localhost.postman_environment.json

 

You can have the test scripts in Postman’s Tests, that will be also tested and show in the later HTML report.

 

e.q.

 

 

Run tests and export report

 

The following command will generate the HTML report "newman/Demo-2022-03-27-16-23-46-288-0.html".

 

$ newman run "Demo.postman_collection.json" --insecure -e "Localhost.postman_environment.json" -r htmlextra

 

 

The HTML report includes request, response and the result of test scripts.

 

 

 

 

 

Reference


postmanlabs/newman

DannyDainton/newman-reporter-htmlextra

Newman Action

 

 

 

2019年6月23日 星期日

Windows Terminal (Preview) released




Windows Terminal 目前的特色:
1.  多分頁(Multiple tabs)
2.  字體終於可以美美的 (Beautiful text)
3.  自定義設定 (Configurability)

自訂背景圖的方法


打開Windows Terminal,利用快捷鍵CTRL + , 打開profiles.json
"profiles" 裡面找到要修改的Command-line tool (例如 Windows Powershell),加入以下黃色字設定即可自訂背景圖:

PS. backgroundImageStretchMode 可設定為 none/fill/uniform/uniformToFill


"profiles" :
  [
      {
          "name" : "Windows PowerShell",
          "backgroundImage" : "file:\\Pictures\\xxxx.png",
          "backgroundImageOpacity" : 0.8,
          "backgroundImageStretchMode" : "fill"
      }
]






Reference