📜  newman docs (1)

📅  最后修改于: 2023-12-03 14:44:34.605000             🧑  作者: Mango

Newman Docs

Newman Docs is a comprehensive documentation for Newman, a command-line tool that helps with running Postman collections. Newman allows you to run and test Postman collections directly from the command-line, integrate it with your build systems and automate your tests.

Installation

To install Newman, run:

npm install -g newman

This installs Newman globally on your machine.

Usage

To run a collection using Newman, you first need to export your collection from Postman as a JSON file. You can then run the collection using the following command:

newman run path/to/collection.json

This will run the collection and print the results to the console. Newman also supports a number of different command-line options, such as specifying environment variables, running tests on specific folders, and more.

Integrations

Newman can easily be integrated into your build system or continuous integration platform. Newman can run collections in a CI environment and generate reports for you to view the test results.

Here is an example of how to integrate Newman with Jenkins:

  1. Install the Jenkins Postman plugin
  2. Configure your build step to run Newman with your collection
  3. Configure the Jenkins Postman plugin to view test results
Reporting

Newman generates a comprehensive report of your test run. You can choose to output this report in different formats, including HTML and JSON.

To output an HTML report, run the following command:

newman run path/to/collection.json --reporter-html myreport.html

This will generate an HTML report of your test run, which you can view in a browser.

Conclusion

Newman Docs is a powerful tool that can help you automate your API testing workflows. It's easy to use, and makes it simple to integrate with your existing tools and workflows. Try it out today and see how it can benefit your team!