Integrate Postman test scripts with Jenkins build server

后端 未结 3 1289
情书的邮戳
情书的邮戳 2021-02-09 08:21

I\'ve downloaded the POSTMAN Chrome app in order to test some Web APIs on my local dev environment.

In addition, I\'ve downloaded the Newman cmd-line utility for Postman

3条回答
  •  故里飘歌
    2021-02-09 09:12

    Final solution was :

    1) Add build step "Execute Windows batch command" and add two lines below:

    2) change dir to newman\bin:

      cd \Users\bob\appdata\roaming\npm\node_modules\newman\bin
    

    3) run node newman as opposed to simply trying to run newman

      node newman -c "C:\\Users\\bob\\Documents\\POSTMAN Files\\Workbench-API-Collection.json"
    

    The two tricky parts were:

    1) running newman like this newman -c myCollection.json was not working, as Jenkins could not resolve this node module as it would in a straight Win cmd prompt.

    2) Trying to locate the Newman module was difficult, as it's hidden inside %appdata% folder (i.e. c:\users\bob\$appdata$ ).

    I hope this helps someone in the future.

    good luck.

提交回复
热议问题